public final class RawInt32 extends Object implements IntTranscoder
This pair provides a mechanism called canonical form serialization. In this representations all 32-bits integer are encoded over 4 bytes. This library provides two variants big-endian and small-endian. In both cases, the inner bits of each byte are ordered from the most to the least significant bit. The difference between the two variants is the ordering of the four bytes.
This representation is often used since it is used internally in CPUs, therefore programmers using a low level languages (assembly, C, ...) appreciate using it (for ease of use or performance reasons). When integers are directly copied from memory, it is required to ensure this serializer uses the appropriate endianness on both ends.
More details availabile on the Wikipedia "Endianness page".
Encoding of the value 67305985
Big-Endian variant:n.b. This class doesn't have any dependency against Apache Thrift or any other library in order to provide this convenient integer serialization module to any software using FramedMINA.
Modifier and Type | Method and Description |
---|---|
IoBufferDecoder<Integer> |
getDecoder() |
ByteBufferEncoder<Integer> |
getEncoder() |
public RawInt32(ByteOrder bo)
public IoBufferDecoder<Integer> getDecoder()
getDecoder
in interface IntTranscoder
public ByteBufferEncoder<Integer> getEncoder()
getEncoder
in interface IntTranscoder
Copyright © 2009–2013 Apache MINA Project. All rights reserved.