@Test
public void writeUInt16() throws IOException {

    int uint = (int) Math.pow(2, 16) - 1;
    writer.writeUInt16(uint);
    assertAndResetStreamContents(new byte[]{(byte) 0xff, (byte) 0xff});
    uint = 0;
    writer.writeUInt16(uint);
    assertAndResetStreamContents(new byte[]{0, 0});
    uint = 12345;
    writer.writeUInt16(uint);
    assertAndResetStreamContents(new byte[]{0x39, 0x30});
}