@Test public void testHashCode() { Map<byte[], Integer> map = new LinkedHashMap<byte[], Integer>(); map.put(EMPTY_BYTES, 1); map.put(new byte[] { 1 }, 32); map.put(new byte[] { 2 }, 33); map.put(new byte[] { 0, 1 }, 962); map.put(new byte[] { 1, 2 }, 994); map.put(new byte[] { 0, 1, 2, 3, 4, 5 }, 63504931); map.put(new byte[] { 6, 7, 8, 9, 0, 1 }, (int) 97180294697L); map.put(new byte[] { -1, -1, -1, (byte) 0xE1 }, 1); for (Entry<byte[], Integer> e: map.entrySet()) { assertEquals( e.getValue().intValue(), ByteBufUtil.hashCode(wrappedBuffer(e.getKey()))); } }
public static ByteBuf wrappedBuffer(byte[] array) { if (array.length == 0) { return EMPTY_BUFFER; } return new UnpooledHeapByteBuf(ALLOC, array, array.length); }
Unpooled { public static ByteBuf wrappedBuffer(byte[] array) { if (array.length == 0) { return EMPTY_BUFFER; } return new UnpooledHeapByteBuf(ALLOC, array, array.length); } }
Unpooled { public static ByteBuf wrappedBuffer(byte[] array) { if (array.length == 0) { return EMPTY_BUFFER; } return new UnpooledHeapByteBuf(ALLOC, array, array.length); } private  Unpooled(); }
Unpooled { public static ByteBuf wrappedBuffer(byte[] array) { if (array.length == 0) { return EMPTY_BUFFER; } return new UnpooledHeapByteBuf(ALLOC, array, array.length); } private  Unpooled(); static ByteBuf buffer(); static ByteBuf directBuffer(); static ByteBuf buffer(int initialCapacity); static ByteBuf directBuffer(int initialCapacity); static ByteBuf buffer(int initialCapacity, int maxCapacity); static ByteBuf directBuffer(int initialCapacity, int maxCapacity); static ByteBuf wrappedBuffer(byte[] array); static ByteBuf wrappedBuffer(byte[] array, int offset, int length); static ByteBuf wrappedBuffer(ByteBuffer buffer); static ByteBuf wrappedBuffer(ByteBuf buffer); static ByteBuf wrappedBuffer(byte[]... arrays); static ByteBuf wrappedBuffer(ByteBuf... buffers); static ByteBuf wrappedBuffer(ByteBuffer... buffers); static ByteBuf wrappedBuffer(int maxNumComponents, byte[]... arrays); static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers); static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers); static CompositeByteBuf compositeBuffer(); static CompositeByteBuf compositeBuffer(int maxNumComponents); static ByteBuf copiedBuffer(byte[] array); static ByteBuf copiedBuffer(byte[] array, int offset, int length); static ByteBuf copiedBuffer(ByteBuffer buffer); static ByteBuf copiedBuffer(ByteBuf buffer); static ByteBuf copiedBuffer(byte[]... arrays); static ByteBuf copiedBuffer(ByteBuf... buffers); static ByteBuf copiedBuffer(ByteBuffer... buffers); static ByteBuf copiedBuffer(CharSequence string, Charset charset); static ByteBuf copiedBuffer(
            CharSequence string, int offset, int length, Charset charset); static ByteBuf copiedBuffer(char[] array, Charset charset); static ByteBuf copiedBuffer(char[] array, int offset, int length, Charset charset); static ByteBuf unmodifiableBuffer(ByteBuf buffer); static ByteBuf copyInt(int value); static ByteBuf copyInt(int... values); static ByteBuf copyShort(int value); static ByteBuf copyShort(short... values); static ByteBuf copyShort(int... values); static ByteBuf copyMedium(int value); static ByteBuf copyMedium(int... values); static ByteBuf copyLong(long value); static ByteBuf copyLong(long... values); static ByteBuf copyBoolean(boolean value); static ByteBuf copyBoolean(boolean... values); static ByteBuf copyFloat(float value); static ByteBuf copyFloat(float... values); static ByteBuf copyDouble(double value); static ByteBuf copyDouble(double... values); static ByteBuf unreleasableBuffer(ByteBuf buf); }
Unpooled { public static ByteBuf wrappedBuffer(byte[] array) { if (array.length == 0) { return EMPTY_BUFFER; } return new UnpooledHeapByteBuf(ALLOC, array, array.length); } private  Unpooled(); static ByteBuf buffer(); static ByteBuf directBuffer(); static ByteBuf buffer(int initialCapacity); static ByteBuf directBuffer(int initialCapacity); static ByteBuf buffer(int initialCapacity, int maxCapacity); static ByteBuf directBuffer(int initialCapacity, int maxCapacity); static ByteBuf wrappedBuffer(byte[] array); static ByteBuf wrappedBuffer(byte[] array, int offset, int length); static ByteBuf wrappedBuffer(ByteBuffer buffer); static ByteBuf wrappedBuffer(ByteBuf buffer); static ByteBuf wrappedBuffer(byte[]... arrays); static ByteBuf wrappedBuffer(ByteBuf... buffers); static ByteBuf wrappedBuffer(ByteBuffer... buffers); static ByteBuf wrappedBuffer(int maxNumComponents, byte[]... arrays); static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers); static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers); static CompositeByteBuf compositeBuffer(); static CompositeByteBuf compositeBuffer(int maxNumComponents); static ByteBuf copiedBuffer(byte[] array); static ByteBuf copiedBuffer(byte[] array, int offset, int length); static ByteBuf copiedBuffer(ByteBuffer buffer); static ByteBuf copiedBuffer(ByteBuf buffer); static ByteBuf copiedBuffer(byte[]... arrays); static ByteBuf copiedBuffer(ByteBuf... buffers); static ByteBuf copiedBuffer(ByteBuffer... buffers); static ByteBuf copiedBuffer(CharSequence string, Charset charset); static ByteBuf copiedBuffer(
            CharSequence string, int offset, int length, Charset charset); static ByteBuf copiedBuffer(char[] array, Charset charset); static ByteBuf copiedBuffer(char[] array, int offset, int length, Charset charset); static ByteBuf unmodifiableBuffer(ByteBuf buffer); static ByteBuf copyInt(int value); static ByteBuf copyInt(int... values); static ByteBuf copyShort(int value); static ByteBuf copyShort(short... values); static ByteBuf copyShort(int... values); static ByteBuf copyMedium(int value); static ByteBuf copyMedium(int... values); static ByteBuf copyLong(long value); static ByteBuf copyLong(long... values); static ByteBuf copyBoolean(boolean value); static ByteBuf copyBoolean(boolean... values); static ByteBuf copyFloat(float value); static ByteBuf copyFloat(float... values); static ByteBuf copyDouble(double value); static ByteBuf copyDouble(double... values); static ByteBuf unreleasableBuffer(ByteBuf buf); static final ByteOrder BIG_ENDIAN; static final ByteOrder LITTLE_ENDIAN; static final ByteBuf EMPTY_BUFFER; }