IN - The type that will be produced by decodingOUT - The type that will be consumed by encodingpublic class LengthFieldCodec<IN,OUT> extends java.lang.Object implements Codec<Buffer,IN,OUT>
| Constructor and Description |
|---|
LengthFieldCodec(Codec<Buffer,IN,OUT> delegate)
Create a length-field codec that reads the first integer as the length of the
remaining message.
|
LengthFieldCodec(int lengthFieldLength,
Codec<Buffer,IN,OUT> delegate)
Create a length-field codec that reads the first short, integer, or long as the
length of the remaining message, and prepends a short, integer, long to its output.
|
| Modifier and Type | Method and Description |
|---|---|
Function<Buffer,IN> |
decoder(Consumer<IN> next)
Provide the caller with a decoder to turn a source object into an instance of the input
type.
|
Function<OUT,Buffer> |
encoder()
Provide the caller with an encoder to turn an output object into an instance of the source
type.
|
public LengthFieldCodec(Codec<Buffer,IN,OUT> delegate)
delegate - The delegate Codec.public LengthFieldCodec(int lengthFieldLength,
Codec<Buffer,IN,OUT> delegate)
lengthFieldLength - The size of the length field. Valid values are 4 (int) or 8 (long).delegate - The delegate Codec.