From 6b62b3a6c79064ee72f23ad2208f992910f62eb4 Mon Sep 17 00:00:00 2001 From: Chris Vest Date: Wed, 12 May 2021 10:52:51 +0200 Subject: [PATCH] The pooling buffer allocator must allocate buffers with native byte order by default --- .../java/io/netty/buffer/api/pool/PooledBufferAllocator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/netty/buffer/api/pool/PooledBufferAllocator.java b/src/main/java/io/netty/buffer/api/pool/PooledBufferAllocator.java index 420c12f..bebe1ba 100644 --- a/src/main/java/io/netty/buffer/api/pool/PooledBufferAllocator.java +++ b/src/main/java/io/netty/buffer/api/pool/PooledBufferAllocator.java @@ -32,6 +32,7 @@ import io.netty.util.internal.ThreadExecutorMap; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; +import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -283,7 +284,7 @@ public class PooledBufferAllocator implements BufferAllocator, BufferAllocatorMe @Override public Buffer allocate(int size) { - return allocate(new PooledAllocatorControl(), size); + return allocate(new PooledAllocatorControl(), size).order(ByteOrder.nativeOrder()); } Buffer allocate(PooledAllocatorControl control, int size) {