code: private static void writeField(final OutputStream out, final int num) throws IOException {
      final byte[] bytes = BigInteger.valueOf(num).toByteArray();
      writeField(out, bytes);
    }
docs: Convert int to a big-endian byte array containing the minimum number of bytes required to
  represent it. Write those bytes to an {@link OutputStream}.
  @param out {@link OutputStream}
  @param num int