[#1704] Make sure SwappedByteBuf.readSlice(..) returns ByteBuf with correct ByteOrder

This commit is contained in:
Norman Maurer 2013-08-06 12:22:22 +02:00
parent 3b94154893
commit ea1dca8105
2 changed files with 2 additions and 1 deletions

View File

@ -497,7 +497,7 @@ public final class SwappedByteBuf extends ByteBuf {
@Override
public ByteBuf readSlice(int length) {
return buf.readSlice(length);
return buf.readSlice(length).order(order);
}
@Override

View File

@ -1254,6 +1254,7 @@ public abstract class AbstractByteBufTest {
assertEquals(i, buffer.readerIndex());
assertEquals(CAPACITY, buffer.writerIndex());
ByteBuf actualValue = buffer.readSlice(BLOCK_SIZE);
assertEquals(buffer.order(), actualValue.order());
assertEquals(wrappedBuffer(expectedValue), actualValue);
// Make sure if it is a sliced buffer.