Add the factory to create the buffer
This commit is contained in:
parent
bfeb9ffd9a
commit
c9da4931c7
@ -78,8 +78,8 @@ public class FixedLengthFrameDecoder extends FrameDecoder {
|
||||
protected ChannelBuffer newCumulationBuffer(ChannelHandlerContext ctx, int minimumCapacity) {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
if (allocateFullBuffer) {
|
||||
return ChannelBuffers.buffer(
|
||||
factory.getDefaultOrder(), frameLength);
|
||||
return factory.getBuffer(frameLength);
|
||||
|
||||
}
|
||||
return super.newCumulationBuffer(ctx, minimumCapacity);
|
||||
}
|
||||
|
@ -390,7 +390,6 @@ public abstract class FrameDecoder extends SimpleChannelUpstreamHandler {
|
||||
protected ChannelBuffer newCumulationBuffer(
|
||||
ChannelHandlerContext ctx, int minimumCapacity) {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
return ChannelBuffers.buffer(
|
||||
factory.getDefaultOrder(), Math.max(minimumCapacity, 256));
|
||||
return factory.getBuffer(Math.max(minimumCapacity, 256));
|
||||
}
|
||||
}
|
||||
|
@ -647,7 +647,6 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
|
||||
protected ChannelBuffer newCumulationBuffer(
|
||||
ChannelHandlerContext ctx, int minimumCapacity) {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
return ChannelBuffers.buffer(
|
||||
factory.getDefaultOrder(), Math.max(minimumCapacity, 256));
|
||||
return factory.getBuffer(Math.max(minimumCapacity, 256));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user