Fix a bug in AbstractByteBuf.writeZero() where the capacity is not auto-expanded
This commit is contained in:
parent
fc7c950b08
commit
f0a3f849f7
@ -862,8 +862,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int writeBytes(ScatteringByteChannel in, int length)
|
||||
throws IOException {
|
||||
public int writeBytes(ScatteringByteChannel in, int length) throws IOException {
|
||||
ensureWritable(length);
|
||||
int writtenBytes = setBytes(writerIndex, in, length);
|
||||
if (writtenBytes > 0) {
|
||||
@ -878,6 +877,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
ensureWritable(length);
|
||||
checkIndex(writerIndex, length);
|
||||
|
||||
int nLong = length >>> 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user