com.kuka.comm.codec.bytebuffer
Class ByteOrderEncoder

java.lang.Object
  extended by com.kuka.comm.codec.Encoder<Object,ByteBuffer>
      extended by com.kuka.comm.codec.bytebuffer.ByteOrderEncoder

public final class ByteOrderEncoder
extends Encoder<Object,ByteBuffer>

An Encoder to modify the byte order of a ByteBuffer. The position and limit of the passed byte buffer will not be changed.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.kuka.comm.codec.Encoder
Encoder.EncoderContext
 
Constructor Summary
ByteOrderEncoder(ByteOrder byteOrder)
          Creates a new encoder, that modifies the byte order of the given byte buffer.
 
Method Summary
protected  void encodeImpl(Object in, ByteBuffer out)
          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

ByteOrderEncoder

public ByteOrderEncoder(ByteOrder byteOrder)
Creates a new encoder, that modifies the byte order of the given byte buffer.

Parameters:
byteOrder - the preferred byte order, either ByteOrder.BIG_ENDIAN or ByteOrder.LITTLE_ENDIAN
Method Detail

encodeImpl

protected void encodeImpl(Object in,
                          ByteBuffer out)
Description copied from class: Encoder
Override this method to implement encoding process.

Note: You should override either this method or Encoder.encodeImpl(Object, Object, EncoderContext). Overriding both will have no effect, i.e. only Encoder.encodeImpl(Object, Object, EncoderContext) will be called.

Overrides:
encodeImpl in class Encoder<Object,ByteBuffer>
Parameters:
in - the input for this encoder
out - the output for this encoder
See Also:
Encoder.encodeImpl(Object, Object, EncoderContext)


Copyright © 2019. All rights reserved.