T- the type of the object marshalled
public interface SizedWriter<T> extends Marshallable
SizedReader, which knows the length of serialized form of any object before actual serialization 2) doesn't include that length in the serialized form itself, assuming it will be passed by the
SizedReader.read(net.openhft.chronicle.bytes.Bytes, long, T)deserialization method.
|Modifier and Type||Method and Description|
Returns the length (in bytes) of the serialized form of the given object.
Serializes the given object to the given
$equals, $fieldInfos, $hashCode, $toString, copyFrom, deepCopy, fromFile, fromFile, fromFileAsMap, fromFileAsMap, fromHexString, fromString, getField, mergeToMap, readMarshallable, setField, writeMarshallable
long size(@NotNull T toWrite)
write(out, size, toWrite)call.
toWrite- the object which serialized form length should be returned
out, without writing the length of the serialized form itself.
Implementation of this method should increment the position of the given
size(toWrite). The given object
should be written into these range between the initial
bytes' position and the
position after this method call returns.
Bytesto write the given object to
size- the size, returned by
size(Object)for the given
toWriteobject. it is given, because size might be needed during serialization, and it's computation has non-constant complexity, i. e. if serializing a
CharSequenceusing variable-length encoding like UTF-8.
toWrite- the object to serialize
SizedReader.read(Bytes, long, Object)
Copyright © 2017. All rights reserved.