Skip to content

Commit 088cad9

Browse files
authored
use heap buffers in the default payload decoder (#945)
1 parent 4e379f1 commit 088cad9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rsocket-core/src/main/java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public Payload apply(ByteBuf byteBuf) {
5252
throw new IllegalArgumentException("unsupported frame type: " + type);
5353
}
5454

55-
ByteBuffer data = ByteBuffer.allocateDirect(d.readableBytes());
55+
ByteBuffer data = ByteBuffer.allocate(d.readableBytes());
5656
data.put(d.nioBuffer());
5757
data.flip();
5858

5959
if (m != null) {
60-
ByteBuffer metadata = ByteBuffer.allocateDirect(m.readableBytes());
60+
ByteBuffer metadata = ByteBuffer.allocate(m.readableBytes());
6161
metadata.put(m.nioBuffer());
6262
metadata.flip();
6363

0 commit comments

Comments
 (0)