code: protected static void writeInt(int value, byte[] bytes, int offset, int length)
      {
          for (int i = length - 1; i >= 0; --i)
          {
              bytes[offset + i] = (byte)(value & 0xFF);
              value >>= 8;
          }
      }
docs: Writes an integer value to <code>bytes</code> in network byte order
  
  @param value  The integer value to write
  @param bytes  The bytes where the integer value is written to
  @param offset The offset in <code>bytes</code>from where to start writing the integer
  @param length The number of bytes to write