Package org.fusesource.hawtbuf.codec
Class VariableCodec<T>
java.lang.Object
org.fusesource.hawtbuf.codec.VariableCodec<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Codec<T>
- Direct Known Subclasses:
AbstractBufferCodec
,ObjectCodec
,PBMessageFramedCodec
,PBMessageUnframedCodec
Convenience base class for Marshaller implementations which do not deepCopy and
which use variable size encodings.
-
Constructor Details
-
VariableCodec
public VariableCodec()
-
-
Method Details
-
getFixedSize
public int getFixedSize()- Specified by:
getFixedSize
in interfaceCodec<T>
- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
isDeepCopySupported
public boolean isDeepCopySupported()- Specified by:
isDeepCopySupported
in interfaceCodec<T>
- Returns:
- true if the
Codec.deepCopy(Object)
operations is supported.
-
deepCopy
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()- Specified by:
isEstimatedSizeSupported
in interfaceCodec<T>
- Returns:
- true if the
Codec.estimatedSize(Object)
operation is supported.
-
estimatedSize
- Specified by:
estimatedSize
in interfaceCodec<T>
- Parameters:
object
-- Returns:
- the estimated marshaled size of the object.
-