Consider writerIndex when LzfDecoder writes into a new heap buffer

Motivation:

Now LzfDecoder do not consider writerIndex when it writes into array of a new heap buffer (when it decodes a compressed chuck of data)
This commit is contained in:
Idel Pivnitskiy 2014-08-06 00:34:35 +04:00 committed by Norman Maurer
parent e59ec5384d
commit 12c614a7eb

View File

@ -147,7 +147,7 @@ public class LzfDecoder extends ByteToMessageDecoder {
ByteBuf uncompressed = ctx.alloc().heapBuffer(originalLength, originalLength);
final byte[] outputArray = uncompressed.array();
final int outPos = uncompressed.arrayOffset();
final int outPos = uncompressed.arrayOffset() + uncompressed.writerIndex();
boolean success = false;
try {