|
3 | 3 | import io.netty.buffer.ByteBuf; |
4 | 4 | import io.netty.buffer.ByteBufAllocator; |
5 | 5 | import io.netty.buffer.Unpooled; |
6 | | -import io.rsocket.buffer.TupleByteBuf; |
7 | 6 |
|
8 | 7 | class DataAndMetadataFlyweight { |
9 | 8 | public static final int FRAME_LENGTH_MASK = 0xFFFFFF; |
@@ -33,20 +32,19 @@ private static int decodeLength(final ByteBuf byteBuf) { |
33 | 32 |
|
34 | 33 | static ByteBuf encodeOnlyMetadata( |
35 | 34 | ByteBufAllocator allocator, final ByteBuf header, ByteBuf metadata) { |
36 | | - return TupleByteBuf.of(allocator, header, metadata); |
| 35 | + return allocator.compositeBuffer().addComponents(true, header, metadata); |
37 | 36 | } |
38 | 37 |
|
39 | 38 | static ByteBuf encodeOnlyData(ByteBufAllocator allocator, final ByteBuf header, ByteBuf data) { |
40 | | - return TupleByteBuf.of(allocator, header, data); |
| 39 | + return allocator.compositeBuffer().addComponents(true, header, data); |
41 | 40 | } |
42 | 41 |
|
43 | 42 | static ByteBuf encode( |
44 | 43 | ByteBufAllocator allocator, final ByteBuf header, ByteBuf metadata, ByteBuf data) { |
45 | 44 |
|
46 | 45 | int length = metadata.readableBytes(); |
47 | 46 | encodeLength(header, length); |
48 | | - |
49 | | - return TupleByteBuf.of(allocator, header, metadata, data); |
| 47 | + return allocator.compositeBuffer().addComponents(true, header, metadata, data); |
50 | 48 | } |
51 | 49 |
|
52 | 50 | static ByteBuf metadataWithoutMarking(ByteBuf byteBuf, boolean hasMetadata) { |
|
0 commit comments