427587 - MessageInputStream must copy the payload.

Forgot to flip the buffer.
This commit is contained in:
Simone Bordet 2014-02-06 22:39:02 +01:00
parent cf37533d87
commit 21d938f12d
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ public class MessageInputStream extends InputStream implements MessageAppender
int capacity = framePayload.remaining(); int capacity = framePayload.remaining();
// TODO: the copy buffer should be pooled too, but no buffer pool available from here. // TODO: the copy buffer should be pooled too, but no buffer pool available from here.
ByteBuffer copy = framePayload.isDirect() ? ByteBuffer.allocateDirect(capacity) : ByteBuffer.allocate(capacity); ByteBuffer copy = framePayload.isDirect() ? ByteBuffer.allocateDirect(capacity) : ByteBuffer.allocate(capacity);
copy.put(framePayload); copy.put(framePayload).flip();
buffers.put(copy); buffers.put(copy);
} }
catch (InterruptedException e) catch (InterruptedException e)