Add the factory to create the buffer

This commit is contained in:
norman 2012-04-24 13:01:49 +02:00
parent bfeb9ffd9a
commit c9da4931c7
3 changed files with 4 additions and 6 deletions

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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));
}
}