From 208411f9a94ee5382929c9930936da5ff77ee4e7 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 2 Nov 2013 14:27:23 +0100 Subject: [PATCH] Also pass the ByteOrder in getUnadjustedFrameLength method. Part of #1960 --- .../netty/handler/codec/LengthFieldBasedFrameDecoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java b/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java index 9ec81c81b9..2aa95cba71 100644 --- a/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java @@ -370,7 +370,7 @@ public class LengthFieldBasedFrameDecoder extends ByteToMessageDecoder { } int actualLengthFieldOffset = in.readerIndex() + lengthFieldOffset; - long frameLength = getUnadjustedFrameLength(in, actualLengthFieldOffset, lengthFieldLength); + long frameLength = getUnadjustedFrameLength(in, actualLengthFieldOffset, lengthFieldLength, byteOrder); if (frameLength < 0) { in.skipBytes(lengthFieldEndOffset); @@ -434,8 +434,8 @@ public class LengthFieldBasedFrameDecoder extends ByteToMessageDecoder { * * @throws DecoderException if failed to decode the specified region */ - protected long getUnadjustedFrameLength(ByteBuf buf, int offset, int length) { - buf = buf.order(byteOrder); + protected long getUnadjustedFrameLength(ByteBuf buf, int offset, int length, ByteOrder order) { + buf = buf.order(order); long frameLength; switch (length) { case 1: