RFC8294ByteBufUtils { public static @NonNull Uint24 readUint24(final ByteBuf buf) { return new Uint24(Uint32.fromIntBits(buf.readMedium())); } private  RFC8294ByteBufUtils(); static @NonNull Uint24 readUint24(final ByteBuf buf); static void writeUint24(final ByteBuf buf, final Uint24 value); static void writeMandatoryUint24(final ByteBuf buf, final Uint24 value, final String name); static void writeOptionalUint24(final ByteBuf buf, final @Nullable Uint24 value); static void writeUint24OrZero(final ByteBuf buf, final @Nullable Uint24 value);  }
@Test public void testRead() { final ByteBuf buf = Unpooled.buffer().writeMedium(0x010203); assertEquals(ONE_TWO_THREE, RFC8294ByteBufUtils.readUint24(buf)); assertEquals(0, buf.readableBytes()); }