From 088cad9f40dc63545ddcbd3486412fbcca7e7ccd Mon Sep 17 00:00:00 2001 From: Sergey Tselovalnikov Date: Tue, 13 Oct 2020 22:08:25 +1100 Subject: [PATCH] use heap buffers in the default payload decoder (#945) --- .../java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rsocket-core/src/main/java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java b/rsocket-core/src/main/java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java index e6874c097..0d8063e0b 100644 --- a/rsocket-core/src/main/java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java +++ b/rsocket-core/src/main/java/io/rsocket/frame/decoder/DefaultPayloadDecoder.java @@ -52,12 +52,12 @@ public Payload apply(ByteBuf byteBuf) { throw new IllegalArgumentException("unsupported frame type: " + type); } - ByteBuffer data = ByteBuffer.allocateDirect(d.readableBytes()); + ByteBuffer data = ByteBuffer.allocate(d.readableBytes()); data.put(d.nioBuffer()); data.flip(); if (m != null) { - ByteBuffer metadata = ByteBuffer.allocateDirect(m.readableBytes()); + ByteBuffer metadata = ByteBuffer.allocate(m.readableBytes()); metadata.put(m.nioBuffer()); metadata.flip();