Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public FramedResponseStreamHandler(ResultCallback<Frame> resultCallback) {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {

rawBuffer.writeBytes(msg.copy(), 0, msg.readableBytes());
rawBuffer.writeBytes(msg, 0, msg.readableBytes());

Frame frame = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public void close() {
}

private String getBodyAsMessage(ByteBuf body) {
return body.readBytes(body.readableBytes()).toString(Charset.forName("UTF-8"));
String result = body.readBytes(body.readableBytes()).toString(Charset.forName("UTF-8"));
body.discardReadBytes();
body.release();
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public JsonResponseCallbackHandler(TypeReference<T> typeReference, ResultCallbac
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
byte[] buffer = new byte[msg.readableBytes()];
msg.readBytes(buffer);
msg.discardReadBytes();

T object = null;

Expand Down