public static int readUint16BE(ByteBuffer buf) throws BufferUnderflowException {
        return Short.toUnsignedInt(buf.order(ByteOrder.BIG_ENDIAN).getShort());
    }
@Test
    public void testReadUint16BE() {
        assertEquals(258L, ByteUtils.readUint16BE(new byte[]{1, 2}, 0));
        assertEquals(258L, ByteUtils.readUint16BE(new byte[]{1, 2, 3, 4}, 0));
        assertEquals(772L, ByteUtils.readUint16BE(new byte[]{0, 0, 3, 4}, 2));
    }