withLimit

inline fun <T : Buffer> T.withLimit(limit: Int): T

Utility function wrapping the Buffer.limit call on older JDKs where it always returns a plain Buffer instead of the correct type