From 0ac31ae846740bbcc14aca1129b9f8fdc2835d52 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 4 Apr 2013 17:26:14 +0900 Subject: [PATCH] Make Unpooled*ByteBuf public so that ByteBufAllocator implementor can extend it --- .../main/java/io/netty/buffer/UnpooledDirectByteBuf.java | 6 +++--- .../src/main/java/io/netty/buffer/UnpooledHeapByteBuf.java | 6 +++--- .../java/io/netty/buffer/UnpooledUnsafeDirectByteBuf.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/UnpooledDirectByteBuf.java b/buffer/src/main/java/io/netty/buffer/UnpooledDirectByteBuf.java index 8511730a1f..689ac4755d 100644 --- a/buffer/src/main/java/io/netty/buffer/UnpooledDirectByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/UnpooledDirectByteBuf.java @@ -34,7 +34,7 @@ import java.util.Queue; * and {@link Unpooled#wrappedBuffer(ByteBuffer)} instead of calling the * constructor explicitly. */ -final class UnpooledDirectByteBuf extends AbstractReferenceCountedByteBuf { +public class UnpooledDirectByteBuf extends AbstractReferenceCountedByteBuf { private final ResourceLeak leak = leakDetector.open(this); private final ByteBufAllocator alloc; @@ -51,7 +51,7 @@ final class UnpooledDirectByteBuf extends AbstractReferenceCountedByteBuf { * @param initialCapacity the initial capacity of the underlying direct buffer * @param maxCapacity the maximum capacity of the underlying direct buffer */ - UnpooledDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { + protected UnpooledDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { super(maxCapacity); if (alloc == null) { throw new NullPointerException("alloc"); @@ -76,7 +76,7 @@ final class UnpooledDirectByteBuf extends AbstractReferenceCountedByteBuf { * * @param maxCapacity the maximum capacity of the underlying direct buffer */ - UnpooledDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity) { + protected UnpooledDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity) { super(maxCapacity); if (alloc == null) { throw new NullPointerException("alloc"); diff --git a/buffer/src/main/java/io/netty/buffer/UnpooledHeapByteBuf.java b/buffer/src/main/java/io/netty/buffer/UnpooledHeapByteBuf.java index 21a61964ca..affae8f8aa 100644 --- a/buffer/src/main/java/io/netty/buffer/UnpooledHeapByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/UnpooledHeapByteBuf.java @@ -29,7 +29,7 @@ import java.nio.channels.ScatteringByteChannel; /** * Big endian Java heap buffer implementation. */ -final class UnpooledHeapByteBuf extends AbstractReferenceCountedByteBuf { +public class UnpooledHeapByteBuf extends AbstractReferenceCountedByteBuf { private final ByteBufAllocator alloc; private byte[] array; @@ -41,7 +41,7 @@ final class UnpooledHeapByteBuf extends AbstractReferenceCountedByteBuf { * @param initialCapacity the initial capacity of the underlying byte array * @param maxCapacity the max capacity of the underlying byte array */ - public UnpooledHeapByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { + protected UnpooledHeapByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { this(alloc, new byte[initialCapacity], 0, 0, maxCapacity); } @@ -51,7 +51,7 @@ final class UnpooledHeapByteBuf extends AbstractReferenceCountedByteBuf { * @param initialArray the initial underlying byte array * @param maxCapacity the max capacity of the underlying byte array */ - public UnpooledHeapByteBuf(ByteBufAllocator alloc, byte[] initialArray, int maxCapacity) { + protected UnpooledHeapByteBuf(ByteBufAllocator alloc, byte[] initialArray, int maxCapacity) { this(alloc, initialArray, 0, initialArray.length, maxCapacity); } diff --git a/buffer/src/main/java/io/netty/buffer/UnpooledUnsafeDirectByteBuf.java b/buffer/src/main/java/io/netty/buffer/UnpooledUnsafeDirectByteBuf.java index 815922dfc0..d357ad9cad 100644 --- a/buffer/src/main/java/io/netty/buffer/UnpooledUnsafeDirectByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/UnpooledUnsafeDirectByteBuf.java @@ -34,7 +34,7 @@ import java.util.Queue; * and {@link Unpooled#wrappedBuffer(ByteBuffer)} instead of calling the * constructor explicitly. */ -final class UnpooledUnsafeDirectByteBuf extends AbstractReferenceCountedByteBuf { +public class UnpooledUnsafeDirectByteBuf extends AbstractReferenceCountedByteBuf { private static final boolean NATIVE_ORDER = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; @@ -54,7 +54,7 @@ final class UnpooledUnsafeDirectByteBuf extends AbstractReferenceCountedByteBuf * @param initialCapacity the initial capacity of the underlying direct buffer * @param maxCapacity the maximum capacity of the underlying direct buffer */ - UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { + protected UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity) { super(maxCapacity); if (alloc == null) { throw new NullPointerException("alloc"); @@ -79,7 +79,7 @@ final class UnpooledUnsafeDirectByteBuf extends AbstractReferenceCountedByteBuf * * @param maxCapacity the maximum capacity of the underlying direct buffer */ - UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity) { + protected UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity) { super(maxCapacity); if (alloc == null) { throw new NullPointerException("alloc");