T - The type of object to serialize.public final class FixedLengthStreamingSerializer<T>
extends Object
implements StreamingSerializerDeserializer<T>
StreamingSerializerDeserializer that uses a SerializerDeserializer and frames each object by
preceding it with the length in bytes. The length component is fixed and always consumes 4 bytes.| Constructor and Description |
|---|
FixedLengthStreamingSerializer(SerializerDeserializer<T> serializer,
ToIntFunction<T> bytesEstimator)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Publisher<T> |
deserialize(Publisher<Buffer> serializedData,
BufferAllocator allocator) |
Publisher<Buffer> |
serialize(Publisher<T> toSerialize,
BufferAllocator allocator) |
public FixedLengthStreamingSerializer(SerializerDeserializer<T> serializer, ToIntFunction<T> bytesEstimator)
serializer - The SerializerDeserializer used to serialize/deserialize individual objects.bytesEstimator - Provides the length in bytes for each T being serialized.