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
public abstract class VariableCodec<T> extends java.lang.Object implements Codec<T>
Convenience base class for Marshaller implementations which do not deepCopy and which use variable size encodings.
-
-
Constructor Summary
Constructors Constructor Description VariableCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TdeepCopy(T source)intestimatedSize(T object)intgetFixedSize()booleanisDeepCopySupported()booleanisEstimatedSizeSupported()
-
-
-
Method Detail
-
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSizein 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:
isDeepCopySupportedin interfaceCodec<T>- Returns:
- true if the
Codec.deepCopy(Object)operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()
- Specified by:
isEstimatedSizeSupportedin interfaceCodec<T>- Returns:
- true if the
Codec.estimatedSize(Object)operation is supported.
-
estimatedSize
public int estimatedSize(T object)
- Specified by:
estimatedSizein interfaceCodec<T>- Returns:
- the estimated marshaled size of the object.
-
-