Skip to content

Commit

Permalink
fixes test
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
  • Loading branch information
OlegDokuka committed Mar 8, 2020
1 parent c6cf8eb commit d3915b7
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -182,7 +182,10 @@ public static char[] readUtf8(ByteBuf byteBuf, int length) {
char[] ca = new char[en];

CharBuffer charBuffer = CharBuffer.wrap(ca);
ByteBuffer byteBuffer = byteBuf.internalNioBuffer(byteBuf.readerIndex(), length);
ByteBuffer byteBuffer =
byteBuf.nioBufferCount() == 1
? byteBuf.internalNioBuffer(byteBuf.readerIndex(), length)
: byteBuf.nioBuffer(byteBuf.readerIndex(), length);
byteBuffer.mark();
try {
CoderResult cr = charsetDecoder.decode(byteBuffer, charBuffer, true);
Expand Down

0 comments on commit d3915b7

Please sign in to comment.