Package org.fusesource.hawtbuf.codec
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 long
decodeZigZag
(long n) void
encode
(Long value, DataOutput dataOut) Write the payload of the object to the DataOutput stream.private static long
encodeZigZag
(long n) int
estimatedSize
(Long value) Methods inherited from class org.fusesource.hawtbuf.codec.VarLongCodec
deepCopy, getFixedSize, isDeepCopySupported, isEstimatedSizeSupported
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
VarSignedLongCodec
public VarSignedLongCodec()
-
-
Method Details
-
encode
Description copied from interface:Codec
Write the payload of the object to the DataOutput stream.- Specified by:
encode
in interfaceCodec<Long>
- Overrides:
encode
in classVarLongCodec
- Parameters:
value
-dataOut
-- Throws:
IOException
-
decode
Description copied from interface:Codec
Read the payload of the object from the DataInput stream.- Specified by:
decode
in interfaceCodec<Long>
- Overrides:
decode
in 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:
estimatedSize
in interfaceCodec<Long>
- Overrides:
estimatedSize
in classVarLongCodec
- Parameters:
value
-- Returns:
- the estimated marshaled size of the object.
-