public class EncoderEmbedder<E> extends AbstractCodecEmbedder<E>
String into a Base64-encoded ChannelBuffer with
Base64Encoder and StringEncoder without setting up the
ChannelPipeline and other mock objects by yourself:
String data = "foobar";EncoderEmbedder<ChannelBuffer> embedder = newEncoderEmbedder<>( newBase64Encoder(), newStringEncoder()); embedder.offer(data);ChannelBufferencoded = embedder.poll(); assert encoded.toString(CharsetUtil.US_ASCII).equals("Zm9vYmFy");
DecoderEmbedderproductQueue| Constructor and Description |
|---|
EncoderEmbedder(ChannelBufferFactory bufferFactory,
ChannelDownstreamHandler... handlers)
Creates a new embedder whose pipeline is composed of the specified
handlers.
|
EncoderEmbedder(ChannelDownstreamHandler... handlers)
Creates a new embedder whose pipeline is composed of the specified
handlers.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
offer(java.lang.Object input)
Offers an input object to the pipeline of this embedder.
|
finish, getChannel, getPipeline, isEmpty, peek, poll, pollAll, pollAll, sizepublic EncoderEmbedder(ChannelDownstreamHandler... handlers)
public EncoderEmbedder(ChannelBufferFactory bufferFactory, ChannelDownstreamHandler... handlers)
bufferFactory - the ChannelBufferFactory to be used when
creating a new buffer.public boolean offer(java.lang.Object input)
CodecEmbeddertrue if and only if there is something to read in the
product queue (see CodecEmbedder.poll() and CodecEmbedder.peek())