File tree 3 files changed +30
-19
lines changed
servicetalk-serializer-api/src/main/java/io/servicetalk/serializer/api
3 files changed +30
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 28
28
*/
29
29
@ FunctionalInterface
30
30
public interface StreamingDeserializer <T > {
31
+ /**
32
+ * Deserialize a {@link Publisher} of {@link Buffer} into a {@link Publisher} of {@link T}.
33
+ * @param serializedData the serialized stream of data represented in a {@link Publisher} of {@link Buffer}.
34
+ * @param allocator the {@link BufferAllocator} to use if allocation is required.
35
+ * @return The deserialized {@link Publisher} of {@link T}s.
36
+ */
31
37
Publisher <T > deserialize (Publisher <Buffer > serializedData , BufferAllocator allocator );
32
38
39
+ /**
40
+ * Deserialize a {@link Iterable} of {@link Buffer} into a {@link Iterable} of {@link T}.
41
+ * @param serializedData the serialized stream data represented in a {@link Iterable} of {@link Buffer}.
42
+ * @param allocator the {@link BufferAllocator} to use if allocation is required.
43
+ * @return The deserialized {@link Iterable} of {@link T}s.
44
+ */
33
45
default BlockingIterable <T > deserialize (Iterable <Buffer > serializedData , BufferAllocator allocator ) {
34
46
return deserialize (fromIterable (serializedData ), allocator ).toIterable ();
35
47
}
Original file line number Diff line number Diff line change 29
29
*/
30
30
@ FunctionalInterface
31
31
public interface StreamingSerializer <T > {
32
+ /**
33
+ * Serialize a {@link Publisher} of {@link T}s into a {@link Publisher} of {@link Buffer}.
34
+ * @param toSerialize the deserialized stream of data represented in a {@link Publisher} of {@link T}.
35
+ * @param allocator the {@link BufferAllocator} to use if allocation is required.
36
+ * @return the serialized stream of data represented in a {@link Publisher} of {@link Buffer}.
37
+ */
32
38
Publisher <Buffer > serialize (Publisher <T > toSerialize , BufferAllocator allocator );
33
39
40
+ /**
41
+ * Serialize a {@link Iterable} of {@link T}s into a {@link Iterable} of {@link Buffer}.
42
+ * @param toSerialize the deserialized stream of data represented in a {@link Iterable} of {@link T}.
43
+ * @param allocator the {@link BufferAllocator} to use if allocation is required.
44
+ * @return the serialized stream of data represented in a {@link Iterable} of {@link Buffer}.
45
+ */
34
46
default BlockingIterable <Buffer > serialize (Iterable <T > toSerialize , BufferAllocator allocator ) {
35
47
return serialize (fromIterable (toSerialize ), allocator ).toIterable ();
36
48
}
37
49
50
+ /**
51
+ * Serialize a {@link PayloadWriter} of {@link T}s into a {@link PayloadWriter} of {@link Buffer}.
52
+ * @param writer The {@link PayloadWriter} used to write the result of serialization to.
53
+ * @param allocator the {@link BufferAllocator} to use if allocation is required.
54
+ * @return a {@link PayloadWriter} where you can write {@link T}s to.
55
+ */
38
56
default PayloadWriter <T > serialize (PayloadWriter <Buffer > writer , BufferAllocator allocator ) {
39
57
return StreamingSerializerUtils .serialize (this , writer , allocator );
40
58
}
You can’t perform that action at this time.
0 commit comments