diff --git a/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java b/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java index caadaddcbb..1a4bc5678f 100644 --- a/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java +++ b/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java @@ -225,7 +225,7 @@ public class ByteBufferBackedChannelBuffer extends AbstractChannelBuffer { int readBytes = 0; - if (!buffer.isReadOnly() && buffer.hasArray()) { + if (buffer.hasArray()) { index += buffer.arrayOffset(); do { int localReadBytes = in.read(buffer.array(), index, length); diff --git a/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java b/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java index cc4b3e924e..a5c535080a 100644 --- a/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java +++ b/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java @@ -301,7 +301,7 @@ public class ChannelBuffers { if (!buffer.hasRemaining()) { return EMPTY_BUFFER; } - if (!buffer.isReadOnly() && buffer.hasArray()) { + if (buffer.hasArray()) { return wrappedBuffer(buffer.order(), buffer.array(), buffer.arrayOffset(),buffer.remaining()); } else { return new ByteBufferBackedChannelBuffer(buffer);