SampleSize extends UnsignedIntLEByteValue { public static SampleSize of(byte... values) { return new SampleSize(values); } private  SampleSize(byte... values); private  SampleSize(long value); private  SampleSize(String size); private  SampleSize(ByteBuf byteBuf); static SampleSize of(byte... values); static SampleSize of(long value); static SampleSize of(LengthSupplier lengthSupplier); static SampleSize of(String size); static SampleSize of(ByteBuf byteBuf); static final int NUM_BYTES; }
@Test public void ofBytes() { assertEquals(0L, SampleSize.of(NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE).getAsLong()); assertThrows(IllegalArgumentException.class, () -> SampleSize.of(NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE)); }
@Test public void ofLong() { assertByte(SampleSize.of(1), "0x01000000"); assertByte(SampleSize.of(65535), "0xffff0000"); assertThrows(IllegalArgumentException.class, () -> SampleSize.of(-1)); assertThrows(IllegalArgumentException.class, () -> SampleSize.of(4294967296L)); }
@Test public void ofString() { assertByte(SampleSize.of("1"), "0x01000000"); }
@Test public void testToString() { assertThat(SampleSize.of("1").toString(), containsString("longValue=1,")); }