Move ByteBuffer functions to ByteBufferUtil and avoid duplication