@Test
public void testWriteShort() throws IOException {

  final short value = (short) 256;
  final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  final LittleEndianDataOutputStream littleEndianOut = new LittleEndianDataOutputStream(byteOut);
  littleEndianOut.writeShort(value);
  littleEndianOut.close();
  final byte[] expected =
      ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).putShort(value).array();
  assertTrue(Arrays.equals(expected, byteOut.toByteArray()));
}