IN - The type that will be produced by decodingOUT - The type that will be consumed by encodingpublic class LengthFieldCodec<IN,OUT> extends BufferCodec<IN,OUT>
DEFAULT_DELIMITER, delimiter| 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 |
|---|---|
Buffer |
apply(OUT out)
Execute the logic of the action, accepting the given parameter.
|
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.
|
decode, encodeaddDelimiterIfAny, decoder, doBufferDecode, doDelimitedBufferDecode, encoder, invokeCallbackOrReturnpublic 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.