@Override protected DecoderEmbedder<ChannelBuffer> newContentDecoder(String contentEncoding) throws Exception { if ("gzip".equalsIgnoreCase(contentEncoding) || "x-gzip".equalsIgnoreCase(contentEncoding)) { return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.GZIP)); } if ("deflate".equalsIgnoreCase(contentEncoding) || "x-deflate".equalsIgnoreCase(contentEncoding)) { // To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly. return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.ZLIB_OR_NONE)); } // 'identity' or unsupported return null; } }
/** * Creates a new instance with the specified parameters. */ protected RtspMessageDecoder(int maxInitialLineLength, int maxHeaderSize, int maxContentLength) { super(maxInitialLineLength, maxHeaderSize, maxContentLength * 2); aggregator = new DecoderEmbedder<HttpMessage>(new HttpChunkAggregator(maxContentLength)); }
@Before public void setUp() { this.decoder = new DecoderEmbedder<StompFrame>( new StompFrameDecoder( ) ); }
@Before public void setUp() { this.decoder = new DecoderEmbedder<StompMessage>( new StompMessageDecoder( DefaultStompMessageFactory.INSTANCE ) ); }
private void startNegotiation(boolean fakeLoopback) { Negotiator negotiator = new Negotiator("127.0.0.1", secContext, false); negotiator.overrideLoopbackForTests = fakeLoopback; embedder = new DecoderEmbedder<Object>(negotiator); negotiator.sendHello(embedder.getPipeline().getChannel()); }