|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.codec.Encoder<I,ByteBuffer>
com.kuka.comm.codec.bytebuffer.EnclosingTokenEncoder<I>
I - the input type of this encoderpublic final class EnclosingTokenEncoder<I>
This encoder delimits a payload strictly with a constant prefix and postfix. Hence, it must be given that prefix and postfix are not part of the payload code.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.kuka.comm.codec.Encoder |
|---|
Encoder.EncoderContext |
| Constructor Summary | |
|---|---|
EnclosingTokenEncoder(byte[] prefix,
byte[] postfix)
Creates a new enclosing token encoder. |
|
EnclosingTokenEncoder(String prefix,
String postfix)
Creates a new enclosing token encoder. |
|
| Method Summary | |
|---|---|
protected void |
encodeImpl(I in,
ByteBuffer out,
Encoder.EncoderContext context)
Override this method to implement encoding process. |
| Methods inherited from class com.kuka.comm.codec.Encoder |
|---|
concat, encode, encodeImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnclosingTokenEncoder(String prefix,
String postfix)
First the prefix is put into the output buffer, after that the next concatenated encoder writes to the payload buffer. The postfix is added to the end of the payload.
prefix - The prefix. It may not be null or empty. The prefix must be different from the postfix and it may not
contain the postfix as a substring.postfix - The postfix. It may not be null or empty. The postfix must be different from the prefix and it may not
contain the prefix as a substring.
public EnclosingTokenEncoder(byte[] prefix,
byte[] postfix)
First the prefix is put into the output buffer, after that the next concatenated encoder writes to the payload buffer. The postfix is added to the end of the payload.
prefix - The prefix. It may not be null or empty. The prefix must be different from the postfix and it may not
contain the postfix as a substring.postfix - The postfix. It may not be null or empty. The postfix must be different from the prefix and it may not
contain the prefix as a substring.| Method Detail |
|---|
protected void encodeImpl(I in,
ByteBuffer out,
Encoder.EncoderContext context)
Encoder
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.
encodeImpl in class Encoder<I,ByteBuffer>in - the input for this encoderout - the output for this encodercontext - can be used to do some more encoding after a concatenated encoder finishedEncoder.encodeImpl(Object, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||