withPosition

inline fun <T : Buffer> T.withPosition(position: Int): T

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