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