@Test
public void testWriteLong() throws IOException {

  final long value = 256L;
  final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  final LittleEndianDataOutputStream littleEndianOut = new LittleEndianDataOutputStream(byteOut);
  littleEndianOut.writeLong(value);
  littleEndianOut.close();
  final byte[] expected =
      ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).array();
  assertTrue(Arrays.equals(expected, byteOut.toByteArray()));
}