ByteBuffer.wrap() was not previously setting the offset correctly
Buffer was setting the position for the ByteBuffer assuming it
meant offset.
Because ByteBuffer
does not support setting the offset "Its backing array will be
the given array, and its array offset will be zero.". Because of
this we create an array copy of the usable array in Buffer and pass
that to ByteBuffer.wrap. This only applies to caes where an offset
is set to avoid unnecessary copies of the array.
This causes an error #181 for zlib compression when the Buffer comes
from the HttpParser since the body is just an offset of the underlying
full http message returned.
ByteBuffer.wrap()
was not previously setting the offset correctlyBuffer
was setting the position for theByteBuffer
assuming it meant offset.Because ByteBuffer does not support setting the offset "Its backing array will be the given array, and its array offset will be zero.". Because of this we create an array copy of the usable array in
Buffer
and pass that toByteBuffer.wrap
. This only applies to caes where an offset is set to avoid unnecessary copies of the array.This causes an error #181 for zlib compression when the Buffer comes from the HttpParser since the body is just an offset of the underlying full http message returned.