static void writeIntegerLittleEndian(OutputStream outputStream, int value) throws IOException {
    outputStream.write(0xFF & value);
    outputStream.write(0xFF & (value >> 8));
    outputStream.write(0xFF & (value >> 16));
    outputStream.write(0xFF & (value >> 24));
  }
@Test
  public void testWriteIntegerLittleEndian() throws Exception {
    testWriteIntegerLittleEndian(0, bytes(0, 0, 0, 0));
    testWriteIntegerLittleEndian(42, bytes(42, 0, 0, 0));
    testWriteIntegerLittleEndian(Integer.MAX_VALUE - 5, bytes(0xFA, 0xFF, 0xFF, 0x7F));
    testWriteIntegerLittleEndian(-7, bytes(0xF9, 0xFF, 0xFF, 0xFF));
  }