Encode an integer value as JSON. An array is used to wrap the value:
[ Integer ]

@param out The stream to write JSON to
@param value The integer value to encode
@throws IOException If an I/O error occurs
@see #readInt(InputStream)
494416
public void writeInt(OutputStream out, int value) throws IOException {
        writeStartArray(out);
        writeIntInternal(out, value);
        writeEndArray(out);
    }
937751
private static void writeValue(ObjectOutput out, Fieldable field) throws IOException
   {
      Object o = field.stringValue();
      if (o != null)
      {
         // Use writeObject instead of writeUTF because the value could contain unsupported
         // characters
         out.writeObject(o);
         return;
      }
      o = field.tokenStreamValue();
      if (o != null)
      {
         out.writeObject(o);
         return;
      }
      o = field.readerValue();
      throw new RuntimeException("Unsupported value " + o);
   }
1357133
public JsonWriter value(@NonNull Iterator<?> value) throws IOException {
      Preconditions.checkArgument(inArray() || writeStack.peek() == JsonTokenType.NAME,
                                  "Expecting an array or a name, but found " + writeStack.peek());
      popIf(JsonTokenType.NAME);
      return value(Collect.asIterable(value));
   }
753247
@Override
	public void writeInt(int v) throws IOException {
		outputStream.write(0xFF & v);
		outputStream.write(0xFF & (v >> 8));
		outputStream.write(0xFF & (v >> 16));
		outputStream.write(0xFF & (v >> 24));
		bytesWritten += 4;
	}
683937
private static byte[] writeInt(int value) throws IOException {
        byte[] b = new byte[4];

        b[0] = (byte) (value & 0x000000FF);
        b[1] = (byte) ((value & 0x0000FF00) >> 8);
        b[2] = (byte) ((value & 0x00FF0000) >> 16);
        b[3] = (byte) ((value & 0xFF000000) >> 24);

        return b;
    }
1073197
private static void writeKey(PrintStream out, String value)
    {
        writeJSON(out, value);
        out.print(": ");
    }
266391
public JsonWriter value(long value) throws IOException {
        beforeValue(false);
        out.write(Long.toString(value));
        return this;
    }
242577
public JsonWriter value(Object value) throws IOException {
      Preconditions.checkArgument(inArray() || writeStack.peek() == JsonTokenType.NAME,
                                  "Expecting an array or a name, but found " + writeStack.peek());
      writeObject(value);
      popIf(JsonTokenType.NAME);
      return this;
   }
937603
@Override
  public void write(JsonWriterImpl out, byte []value)
  {
    StringBuilder sb = new StringBuilder();

    Base64Util.encode(sb, value, 0, value.length);

    out.write(sb.toString());
  }
1166327
public JsonWriter value(double value) throws IOException {
        if (!lenient && (Double.isNaN(value) || Double.isInfinite(value))) {
            throw new IllegalArgumentException("Numeric values must be finite, but was " + value);
        }
        beforeValue(false);
        out.append(Double.toString(value));
        return this;
    }
403970
public JsonWriter value(@NonNull Iterable<?> value) throws IOException {
      Preconditions.checkArgument(inArray() || writeStack.peek() == JsonTokenType.NAME,
                                  "Expecting an array or a name, but found " + writeStack.peek());
      popIf(JsonTokenType.NAME);
      beginArray();
      for (Object o : value) {
         value(o);
      }
      endArray();
      return this;
   }
193505
public static void serialize(OutputStream out, @Nonnull  JsonElement json, boolean pretty) throws IOException {
        Validate.notNull(out);
        BufferedOutputStream bufferedOut = new BufferedOutputStream(out);
        OutputStreamWriter w = new OutputStreamWriter(bufferedOut, UTF8);
        if(pretty) {
            serialize(w, json, pretty);
        } else {
            json.serialize(w);
            // subtle bug where not flushing this results in empty string when serializing to a ByteArrayOutputStream
            w.flush();
            bufferedOut.flush();
        }
    }
251395
def write_json_integer(num)
      @context.write(trans)
      escapeNum = @context.escapeNum
      if (escapeNum)
        trans.write(@@kJSONStringDelimiter)
      end
      trans.write(num.to_s);
      if (escapeNum)
        trans.write(@@kJSONStringDelimiter)
      end
    end
1214165
public void writeInt(int value) throws IOException {
    if (4 > buf.length - pos) {
      //not enough space remaining
      byte[] arr = new byte[4];
      arr[0] = (byte) value;
      arr[1] = (byte) (value >> 8);
      arr[2] = (byte) (value >> 16);
      arr[3] = (byte) (value >> 24);
      write(arr, 0, 4);
      return;
    }

    buf[pos] = (byte) value;
    buf[pos + 1] = (byte) (value >> 8);
    buf[pos + 2] = (byte) (value >> 16);
    buf[pos + 3] = (byte) (value >> 24);
    pos += 4;
  }
532099
static public void packInt(DataOutput out, int value) throws IOException {
       // Optimize for the common case where value is small. This is particular important where our caller
       // is SerializerBase.SER_STRING.serialize because most chars will be ASCII characters and hence in this range.
       // credit Max Bolingbroke https://github.com/jankotek/MapDB/pull/489

        int shift = (value & ~0x7F); //reuse variable
        if (shift != 0) {
            //$DELAY$
            shift = 31-Integer.numberOfLeadingZeros(value);
            shift -= shift%7; // round down to nearest multiple of 7
            while(shift!=0){
                out.writeByte((byte) ((value>>>shift) & 0x7F));
                //$DELAY$
                shift-=7;
            }
        }
        //$DELAY$
        out.writeByte((byte) ((value & 0x7F)|0x80));
    }
815692
public JsonWriter value(String value) throws IOException {
        if (value == null) {
            return nullValue();
        }
        beforeValue(false);
        string(value);
        return this;
    }
1276544
public void writeInt(int value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeInt", Integer.valueOf(value));
    getBodyList().add(Integer.valueOf(value));
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeInt");
  }