List of usage examples for io.netty.handler.codec.string LineEncoder LineEncoder
public LineEncoder(LineSeparator lineSeparator, Charset charset)
From source file:diskCacheV111.doors.NettyLineBasedDoor.java
License:Open Source License
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { ChannelPipeline pipeline = ctx.pipeline(); String self = ctx.name();//w w w.j ava 2 s. c o m if (expectProxyProtocol) { pipeline.addBefore("door", "haproxy", new HAProxyMessageDecoder()); } // Decoders pipeline.addBefore(self, "frameDecoder", new LineBasedFrameDecoder(KiB.toBytes(64))); pipeline.addBefore(self, "stringDecoder", new StringDecoder(charset)); // Encoder pipeline.addBefore(self, "lineEncoder", new LineEncoder(lineSeparator, charset)); pipeline.addBefore(self, "logger", new LoggingHandler()); }