public class LongConverter extends Object implements Converter<ByteBuffer>
ByteBuffer
that is capable of handling
integers that fit into 64 bits by using the Java Long
type.Modifier and Type | Field and Description |
---|---|
static ConverterSignature |
INT64_SIGNATURE
Signature for using the converter with unsigned integers.
|
static ConverterSignature |
UINT64_SIGNATURE
Signature for using the converter with signed integers.
|
Constructor and Description |
---|
LongConverter(ConverterSignature signature)
Constructor allowing different signatures.
|
Modifier and Type | Method and Description |
---|---|
UserData<ByteBuffer> |
deserialize(String wireSchema,
ByteBuffer bytes)
Deserializes the data from the wire.
|
ConverterSignature |
getSignature()
Get signature for this converter.
|
WireContents<ByteBuffer> |
serialize(Class<?> typeInfo,
Object data)
Serializes user data to a wire representation.
|
public static final ConverterSignature INT64_SIGNATURE
public static final ConverterSignature UINT64_SIGNATURE
public LongConverter(ConverterSignature signature)
signature
- the signature to usepublic WireContents<ByteBuffer> serialize(Class<?> typeInfo, Object data) throws ConversionException
Converter
serialize
in interface Converter<ByteBuffer>
typeInfo
- Java class describing the type of the data to serializedata
- data to serializeConversionException
- error converting the datapublic UserData<ByteBuffer> deserialize(String wireSchema, ByteBuffer bytes) throws ConversionException
Converter
deserialize
in interface Converter<ByteBuffer>
wireSchema
- wire schema of the serialized databytes
- serialized dataConversionException
- error deserializing from the wirepublic ConverterSignature getSignature()
Converter
getSignature
in interface Converter<ByteBuffer>
Copyright © 2018 CoR-Lab. All rights reserved.