private void writeInt(int value) throws IOException {
    int output = Integer.reverseBytes(value);
    outputStream.write(new byte[]{(byte)(output >> 24), (byte)(output >> 16), (byte)(output >> 8), (byte)output});
  }
private void writeInt(int value)