com.kuka.comm.codec.bytebuffer
Class LengthEncoder<I>
java.lang.Object
com.kuka.comm.codec.Encoder<I,ByteBuffer>
com.kuka.comm.codec.bytebuffer.LengthEncoder<I>
- Type Parameters:
I - the input type of this encoder
public final class LengthEncoder<I>
- extends Encoder<I,ByteBuffer>
Encoder that writes the length of a given variable length payload that is encoded by the next concatenated encoder.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthEncoder
public LengthEncoder(LengthFieldType type)
- Creates a new encoder that writes the length of a given variable length payload.
- Parameters:
type - the type of the length field, must not be null
- Throws:
IllegalArgumentException - if the type is null
encodeImpl
protected void encodeImpl(I in,
ByteBuffer out,
Encoder.EncoderContext context)
- Description copied from class:
Encoder
- Override this method to implement encoding process.
The context is currently only taken into account if this encoder is concatenated to another one
Encoder.concat(Encoder).
Note: You should override either this method or Encoder.encodeImpl(Object, Object). Overriding both will
have no effect, i.e. only Encoder.encodeImpl(Object, Object, EncoderContext) will be called.
- Overrides:
encodeImpl in class Encoder<I,ByteBuffer>
- Parameters:
in - the input for this encoderout - the output for this encodercontext - can be used to do some more encoding after a concatenated encoder finished- See Also:
Encoder.encodeImpl(Object, Object)
Copyright © 2019. All rights reserved.