Fixed a problem where AbstractChannelBuffer.readBytes(int) does not respect the endianness of the original buffer

This commit is contained in:
Trustin Lee 2008-12-06 13:54:16 +00:00
parent df2f9d9d50
commit 549145687e

View File

@ -267,7 +267,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
if (length == 0) { if (length == 0) {
return ChannelBuffers.EMPTY_BUFFER; return ChannelBuffers.EMPTY_BUFFER;
} }
ChannelBuffer buf = ChannelBuffers.buffer(length); ChannelBuffer buf = ChannelBuffers.buffer(order(), length);
buf.writeBytes(this, readerIndex, length); buf.writeBytes(this, readerIndex, length);
readerIndex += length; readerIndex += length;
return buf; return buf;