Fixed a bug where a dynamic buffer's readerIndex goes out of sync on expansion

This commit is contained in:
Trustin Lee 2009-02-26 11:28:21 +00:00
parent fabe3a36c9
commit 9bbce4a223

View File

@ -275,7 +275,7 @@ public class DynamicChannelBuffer extends AbstractChannelBuffer {
} }
ChannelBuffer newBuffer = factory().getBuffer(order(), newCapacity); ChannelBuffer newBuffer = factory().getBuffer(order(), newCapacity);
newBuffer.writeBytes(buffer, readerIndex(), readableBytes()); newBuffer.writeBytes(buffer, 0, writerIndex());
buffer = newBuffer; buffer = newBuffer;
} }
} }