public void writeUshort(int value) throws IOException {
        if (value < 0 || value > 0xFFFF) {
            throw new ExceptionWithContext("Unsigned short value out of range: %d", value);
        }
        write(value);
        write(value >> 8);
    }
@Test
    public void testWriteUshort() throws IOException {
        writer.writeUshort(0);
        writer.writeUshort(0x1122);
        writer.writeUshort(0x8899);
        writer.writeUshort(0xFFFF);

        expectData(0x00, 0x00,
                   0x22, 0x11,
                   0x99, 0x88,
                   0xFF, 0xFF);
    }