Class VarSignedIntegerCodec
java.lang.Object
org.fusesource.hawtbuf.codec.VarIntegerCodec
org.fusesource.hawtbuf.codec.VarSignedIntegerCodec
Implementation of a variable length Codec for a signed Integer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead the payload of the object from the DataInput stream.private static intdecodeZigZag(int n) voidencode(Integer value, DataOutput dataOut) Write the payload of the object to the DataOutput stream.private static intencodeZigZag(int n) intestimatedSize(Integer value) Methods inherited from class VarIntegerCodec
deepCopy, getFixedSize, isDeepCopySupported, isEstimatedSizeSupported
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
VarSignedIntegerCodec
public VarSignedIntegerCodec()
-
-
Method Details
-
encode
Description copied from interface:CodecWrite the payload of the object to the DataOutput stream.- Specified by:
encodein interfaceCodec<Integer>- Overrides:
encodein classVarIntegerCodec- Parameters:
value-dataOut-- Throws:
IOException
-
decode
Description copied from interface:CodecRead the payload of the object from the DataInput stream.- Specified by:
decodein interfaceCodec<Integer>- Overrides:
decodein classVarIntegerCodec- Parameters:
dataIn-- Returns:
- unmarshalled object
- Throws:
IOException
-
decodeZigZag
private static int decodeZigZag(int n) -
encodeZigZag
private static int encodeZigZag(int n) -
estimatedSize
- Specified by:
estimatedSizein interfaceCodec<Integer>- Overrides:
estimatedSizein classVarIntegerCodec- Parameters:
value-- Returns:
- the estimated marshaled size of the object.
-