Puts a int (4 bytes).

@param val the val
@throws IOException Signals that an I/O exception has occurred.
966834
public void putInt(int val) throws IOException {
    if (byteOrder == ByteOrder.BIG_ENDIAN) {
      writeIntCurrentPosition((val >>> 24) & 0xFF);
      writeIntCurrentPosition((val >>> 16) & 0xFF);
      writeIntCurrentPosition((val >>> 8) & 0xFF);
      writeIntCurrentPosition((val >>> 0) & 0xFF);
    }
    else {
      writeIntCurrentPosition((val >>> 0) & 0xFF);
      writeIntCurrentPosition((val >>> 8) & 0xFF);
      writeIntCurrentPosition((val >>> 16) & 0xFF);
      writeIntCurrentPosition((val >>> 24) & 0xFF);
    }
  }
922216
public void putDouble(Double val) throws IOException {
    long v = java.lang.Double.doubleToLongBits(val.getValue());
    if (byteOrder == ByteOrder.BIG_ENDIAN) {
      writeIntCurrentPosition((int) (v >>> 56) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 48) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 40) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 32) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 24) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 16) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 8) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 0) & 0xFF);
    } else {
      writeIntCurrentPosition((int) (v >>> 0) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 8) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 16) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 24) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 32) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 40) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 48) & 0xFF);
      writeIntCurrentPosition((int) (v >>> 56) & 0xFF);
    }
  }
1199430
public void packInt(int value) throws IOException {
        ensureAvail(5); //ensure worst case bytes

        // 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) {
            shift = 31 - Integer.numberOfLeadingZeros(value);
            shift -= shift % 7; // round down to nearest multiple of 7
            while (shift != 0) {
                buf[pos++] = (byte) ((value >>> shift) & 0x7F);
                shift -= 7;
            }
        }
        buf[pos++] = (byte) ((value & 0x7F)| 0x80);
    }
1318865
void write(Object value) throws IOException {
    if (clientInputSerializer != null) {
      clientInputSerializer.serialize(value);
      return;
    }

    byte[] bval;
    int valSize;
    if (value instanceof BytesWritable) {
      BytesWritable val = (BytesWritable) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else if (value instanceof Text) {
      Text val = (Text) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else {
      String sval = value.toString();
      bval = sval.getBytes("UTF-8");
      valSize = bval.length;
    }
    clientOut_.write(bval, 0, valSize);
  }
458530
void writeInt(int value) throws IOException {
        if (value < MIN_FIX_INT) {
            // large negative
            if (value >= Byte.MIN_VALUE) {
                output.writeByte(SINT_8);
                output.writeByte((byte) value);
            } else if (value >= Short.MIN_VALUE) {
                output.writeByte(SINT_16);
                output.writeShort((short) value);
            } else {
                output.writeByte(SINT_32);
                output.writeInt(value);
            }
        } else if (value < MAX_FIX_INT) {
            // in range -64 to 127
            output.writeByte(value);
        } else {
            // large positive
            if (value < 0xFF) {
                output.writeByte(UINT_8);
                output.writeByte((byte) value);
            } else if (value < 0xFFFF) {
                output.writeByte(UINT_16);
                output.writeShort((short) value);
            } else {
                output.writeByte(UINT_32);
                output.writeInt(value);
            }
        }
    }
1245748
@Override
  public void put(double[] val) {
    assert (val.length == elements.length);
    wsum += 1.0;
    for(int i = BitsUtil.nextSetBit(dims, 0); i >= 0; i = BitsUtil.nextSetBit(dims, i + 1)) {
      final double delta = val[i] - elements[i];
      elements[i] += delta / wsum;
    }
  }
437409
private static void appendDigits(final Appendable buffer, final int value) throws IOException {
		buffer.append((char) (value / 10 + '0'));
		buffer.append((char) (value % 10 + '0'));
	}
322481
public void setVal(String val) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(val)) {
            m_value = val.trim();
        } else {
            m_value = val;
        }
    }
1091180
void write(Writable value) throws IOException {
    byte[] bval;
    int valSize;
    if (value instanceof BytesWritable) {
      BytesWritable val = (BytesWritable) value;
      bval = val.get();
      valSize = val.getSize();
    } else if (value instanceof Text) {
      Text val = (Text) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else {
      String sval = value.toString();
      bval = sval.getBytes("UTF-8");
      valSize = bval.length;
    }
    clientOut_.write(bval, 0, valSize);
  }
250692
@Override
  public void writeInt(int n) throws IOException {
    byte[] intBytes = new byte[] { (byte) ((n >>> 24) ^ 0x80),
        (byte) (n >>> 16), (byte) (n >>> 8), (byte) n };
    out.write(intBytes);
  }
1034968
private void writeInt(int value, byte[] data, int offset) {
        int index = offset;
        data[index++] = (byte) (value & 0xff);
        data[index++] = (byte) ((value >> 8) & 0xff);
        data[index++] = (byte) ((value >> 16) & 0xff);
        data[index++] = (byte) ((value >> 24) & 0xff);
    }
855473
public void cdataValue(final String val) throws IOException {
    if (val == null) {
      return;
    }

    int start = 0;

    while (start < val.length()) {
      int end = val.indexOf("]]", start);
      boolean lastSeg = end < 0;
      String seg;

      if (lastSeg) {
        seg = val.substring(start);
      } else {
        seg = val.substring(start, end);
      }

      out("<![CDATA[");
      out(seg);
      out("]]>");

      if (lastSeg) {
        break;
      }

      out("]]");
      start = end + 2;
    }
  }
176517
@CheckReturnValue
  public UnsignedInteger plus(UnsignedInteger val) {
    return fromIntBits(this.value + checkNotNull(val).value);
  }
818169
@Override
    public void writeInt(int value)
        throws IOException
    {
        int offset = _offset;
        byte[] buffer = _buffer;

        if (SIZE <= offset + 16) {
            flushBuffer();
            offset = _offset;
        }

        if (INT_DIRECT_MIN <= value && value <= INT_DIRECT_MAX)
            buffer[offset++] = (byte) (value + BC_INT_ZERO);
        else if (INT_BYTE_MIN <= value && value <= INT_BYTE_MAX) {
            buffer[offset++] = (byte) (BC_INT_BYTE_ZERO + (value >> 8));
            buffer[offset++] = (byte) (value);
        }
        else if (INT_SHORT_MIN <= value && value <= INT_SHORT_MAX) {
            buffer[offset++] = (byte) (BC_INT_SHORT_ZERO + (value >> 16));
            buffer[offset++] = (byte) (value >> 8);
            buffer[offset++] = (byte) (value);
        }
        else {
            buffer[offset++] = (byte) ('I');
            buffer[offset++] = (byte) (value >> 24);
            buffer[offset++] = (byte) (value >> 16);
            buffer[offset++] = (byte) (value >> 8);
            buffer[offset++] = (byte) (value);
        }

        _offset = offset;
    }
1048710
public void write(int v) throws IOException {
	byte b[] = new byte[1];
	b[0] = (byte) v;
	pos += blob.write(b, 0, pos, 1);
    }
814502
public void addValue(int idx, double val) {
        values[idx] = s.plus(values[idx], val); 
    }
127622
private void set(int position, boolean val) {
        // enlarge bitString if necessary
        if (position >= bitString.length) {
            boolean[] tmp = new boolean[position+1];
            System.arraycopy(bitString, 0, tmp, 0, bitString.length);
            bitString = tmp;
        }
        bitString[position] = val;
    }