Fixed a bug where AbstractChannelBuffer.writeBytes() decreases the writerIndex when the specified channel is closed.
This commit is contained in:
parent
33a4a9f8e1
commit
e34d494496
@ -427,7 +427,9 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
|
||||
public int writeBytes(ScatteringByteChannel in, int length)
|
||||
throws IOException {
|
||||
int writtenBytes = setBytes(writerIndex, in, length);
|
||||
writerIndex += writtenBytes;
|
||||
if (writtenBytes > 0) {
|
||||
writerIndex += writtenBytes;
|
||||
}
|
||||
return writtenBytes;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user