Do not assume the ByteBuffer has a backing byte array.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
38f56f5973
commit
b904a5cc85
|
@ -423,9 +423,10 @@ public class HpackEncoder
|
|||
|
||||
if (_debug)
|
||||
{
|
||||
int e = buffer.position();
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("encode {}:'{}' to '{}'", encoding, field, TypeUtil.toHexString(buffer.array(), buffer.arrayOffset() + p, e - p));
|
||||
byte[] bytes = new byte[buffer.position() - p];
|
||||
buffer.position(p);
|
||||
buffer.get(bytes);
|
||||
LOG.debug("encode {}:'{}' to '{}'", encoding, field, TypeUtil.toHexString(bytes));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue