DirectChannelBufferFactory.getBuffer(ByteBuffer) must not return a read only buffer

This commit is contained in:
Trustin Lee 2009-10-16 04:33:04 +00:00
parent 127851df31
commit abfae49a7c

View File

@ -150,7 +150,7 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
}
public ChannelBuffer getBuffer(ByteBuffer nioBuffer) {
if (nioBuffer.isDirect()) {
if (!nioBuffer.isReadOnly() && nioBuffer.isDirect()) {
return ChannelBuffers.wrappedBuffer(nioBuffer);
}