Skip to content

Commit

Permalink
Merge branch 'release/0.12.2-RC2'
Browse files Browse the repository at this point in the history
  • Loading branch information
robertroeser committed Apr 18, 2019
2 parents 32bd149 + 3694844 commit 119d578
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
version=0.12.2-RC1
version=0.12.2-RC2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.Unpooled;
import io.rsocket.buffer.TupleByteBuf;

class DataAndMetadataFlyweight {
public static final int FRAME_LENGTH_MASK = 0xFFFFFF;
Expand Down Expand Up @@ -33,20 +32,19 @@ private static int decodeLength(final ByteBuf byteBuf) {

static ByteBuf encodeOnlyMetadata(
ByteBufAllocator allocator, final ByteBuf header, ByteBuf metadata) {
return TupleByteBuf.of(allocator, header, metadata);
return allocator.compositeBuffer().addComponents(true, header, metadata);
}

static ByteBuf encodeOnlyData(ByteBufAllocator allocator, final ByteBuf header, ByteBuf data) {
return TupleByteBuf.of(allocator, header, data);
return allocator.compositeBuffer().addComponents(true, header, data);
}

static ByteBuf encode(
ByteBufAllocator allocator, final ByteBuf header, ByteBuf metadata, ByteBuf data) {

int length = metadata.readableBytes();
encodeLength(header, length);

return TupleByteBuf.of(allocator, header, metadata, data);
return allocator.compositeBuffer().addComponents(true, header, metadata, data);
}

static ByteBuf metadataWithoutMarking(ByteBuf byteBuf, boolean hasMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.rsocket.buffer.TupleByteBuf;

/**
* Some transports like TCP aren't framed, and require a length. This is used by DuplexConnections
Expand Down Expand Up @@ -35,7 +34,7 @@ private static int decodeLength(final ByteBuf byteBuf) {
public static ByteBuf encode(ByteBufAllocator allocator, int length, ByteBuf frame) {
ByteBuf buffer = allocator.buffer();
encodeLength(buffer, length);
return TupleByteBuf.of(allocator, buffer, frame);
return allocator.compositeBuffer().addComponents(true, buffer, frame);
}

public static int length(ByteBuf byteBuf) {
Expand Down

0 comments on commit 119d578

Please sign in to comment.