@Test public void testWrapShortFromShortArray() { ByteBuf buffer = copyShort(new short[]{1, 4}); assertEquals(4, buffer.capacity()); assertEquals(1, buffer.readShort()); assertEquals(4, buffer.readShort()); assertFalse(buffer.isReadable()); assertEquals(0, copyShort((short[]) null).capacity()); assertEquals(0, copyShort(EMPTY_SHORTS).capacity()); }
public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; }
Unpooled { public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; } }
Unpooled { public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; } private  Unpooled(); }
Unpooled { public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; } 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); @Deprecated 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 ByteBuf unmodifiableBuffer(ByteBuf... buffers); }
Unpooled { public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; } 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); @Deprecated 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 ByteBuf unmodifiableBuffer(ByteBuf... buffers); static final ByteOrder BIG_ENDIAN; static final ByteOrder LITTLE_ENDIAN; static final ByteBuf EMPTY_BUFFER; }