Package org.fusesource.hawtbuf.codec
Class VarLongCodec
java.lang.Object
org.fusesource.hawtbuf.codec.VarLongCodec
- Direct Known Subclasses:
VarSignedLongCodec
Implementation of a variable length Codec for a Long
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead the payload of the object from the DataInput stream.void
encode
(Long object, DataOutput dataOut) Write the payload of the object to the DataOutput stream.int
estimatedSize
(Long object) int
boolean
boolean
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
VarLongCodec
public VarLongCodec()
-
-
Method Details
-
encode
Description copied from interface:Codec
Write the payload of the object to the DataOutput stream.- Specified by:
encode
in interfaceCodec<Long>
- Parameters:
object
-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>
- Parameters:
dataIn
-- Returns:
- unmarshalled object
- Throws:
IOException
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()- Specified by:
isEstimatedSizeSupported
in interfaceCodec<Long>
- Returns:
- true if the
Codec.estimatedSize(Object)
operation is supported.
-
estimatedSize
- Specified by:
estimatedSize
in interfaceCodec<Long>
- Parameters:
object
-- Returns:
- the estimated marshaled size of the object.
-
getFixedSize
public int getFixedSize()- Specified by:
getFixedSize
in interfaceCodec<Long>
- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
deepCopy
-
isDeepCopySupported
public boolean isDeepCopySupported()- Specified by:
isDeepCopySupported
in interfaceCodec<Long>
- Returns:
- true if the
Codec.deepCopy(Object)
operations is supported.
-