Puts a 32-bit integer into the buffer at the given position. Does
not increase the write position.
@param pos the position where to put the integer
@param i the integer to put
485845
public void putInt(int pos, int i) {
		adaptSize(pos + 4);
		ByteBuffer bb = getBuffer(pos);
		int index = pos % _bufferSize;
		if (bb.limit() - index >= 4) {
			bb.putInt(index, i);
		} else {
			byte b0 = (byte)i;
			byte b1 = (byte)(i >> 8);
			byte b2 = (byte)(i >> 16);
			byte b3 = (byte)(i >> 24);
			
			if (_order == ByteOrder.BIG_ENDIAN) {
				putBytes(pos, b3, b2, b1, b0);
			} else {
				putBytes(pos, b0, b1, b2, b3);
			}
		}
	}
1177514
public final static void writeInt(BytesRef dst, int i) {
    dst.bytes[dst.offset] = ((byte) (i >> 24));
    dst.bytes[dst.offset + 1] = ((byte) (i >> 16));
    dst.bytes[dst.offset + 2] = ((byte) (i >> 8));
    dst.bytes[dst.offset + 3] = ((byte) i);
    dst.offset += 4;
  }
451903
public void writeTo(final PacketOutputStream pos) throws IOException {
    pos.write(BINARY_INTRODUCER);
    pos.writeBytesEscaped(bytes, bytes.length, noBackslashEscapes);
    pos.write(QUOTE);
  }
209348
@Override
  public void write(byte []buffer, int offset, int length,
                    boolean isEnd)
    throws IOException
  {
    int position = _position;
    
    if (length < 0) {
      throw new IllegalArgumentException();
    }
    
    if (_indexAddress < position + length) {
      throw new IllegalArgumentException(L.l("Segment write overflow pos=0x{0} len=0x{1} entry-head=0x{2} seg-len=0x{3}. {4}",
                                          Long.toHexString(_position),
                                          Long.toHexString(length),
                                          Long.toHexString(_indexAddress),
                                          Long.toHexString(_segment.length()),
                                          _segment));
    }
    

    //try (StoreWrite sOut = _readWrite.openWrite(_segment.getAddress(),
    //                                                _segment.getLength())) {
    
    _sOut.write(_segment.getAddress() + position, buffer, offset, length);

    _position = position + length;
      
    _isDirty = true;
  }
647153
public void setPos(Object p) {
        Object[] a = (Object[]) p;
        buf = (char[]) a[0];
        int[] v = (int[]) a[1];
        pos.setIndex(v[0]);
        bufPos = v[1];
    }
713593
protected final void setElement(PriorityQueueNode node, int pos)
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "setElement", new Object[] { node, new Integer(pos)});

    elements[pos] = node;
    node.pos      = pos;

//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "setElement");
  }
8068
public static boolean contains(ByteBuffer buf, int position, final short i) {
    final int x = toIntUnsigned(i);
    return (buf.getLong(x / 64 * 8 + position) & (1L << x)) != 0;
  }
864504
@Override
	// @NotThreadSafe
	public void put(long position, byte value) throws IOException {
		int bufferNum = getBufferNum(position);
		mappedBuffers.get(bufferNum).put(getIndex(position), value);
		if(modifiedBuffers!=null) modifiedBuffers.set(bufferNum, true);
	}
462181
private void setValueAtPosition(int pos, ByteArraySegment value) {
        Preconditions.checkElementIndex(pos, getCount(), "pos must be non-negative and smaller than the number of items.");
        Preconditions.checkArgument(value.getLength() == this.config.valueLength, "Given value has incorrect length.");
        this.data.copyFrom(value, pos * this.config.entryLength + this.config.keyLength, value.getLength());
    }
643943
private void bufferInt(long i) {
        buffer((byte) (i & 0xff));
        buffer((byte) ((i >>> 8) & 0xff));
        buffer((byte) ((i >>> 16) & 0xff));
        buffer((byte) ((i >>> 24) & 0xff));
    }
1191944
protected final void putInt16(int i16) {
        ensureCapacity(position + 2);

        byte[] buf = buffer;
        buf[position++] = (byte) (i16 & 0xff);
        buf[position++] = (byte) (i16 >>> 8);
    }
631046
@Override
    public void position(long pos) {
        log.debug("position: {}", pos);
        currentFrame = getFrame(pos);
        log.debug("Setting current sample: {}", currentFrame);
    }
744338
protected void position(int newPosition)
  {
    if (tc.isEntryEnabled()) Tr.entry(tc, "position", new Object[]{this,new Integer(newPosition)});

    newPosition -= _absolutePosition;
    _buffer.position(newPosition);

    if (tc.isEntryEnabled()) Tr.exit(tc, "position");
  }
1320191
public static void writeUnsignedLong(ObjectOutput out, long i) throws IOException {
      while ((i & ~0x7F) != 0) {
         out.writeByte((byte) ((i & 0x7f) | 0x80));
         i >>>= 7;
      }
      out.writeByte((byte) i);
   }
1221899
void insertInputGate(final int pos, final ExecutionGate inputGate) {

		if (this.inputGates[pos] != null) {
			throw new IllegalStateException("Input gate at position " + pos + " is not null");
		}

		this.inputGates[pos] = inputGate;
	}
744545
public void setPosition(Long pos) {
        Interval interval = getInterval();
        if (interval != null) {
            resetInterval(pos, interval.getStartGranularity());
        } else {
            resetInterval(pos, null);
        }
    }
85539
public void putInt(int i) {
        _buffer[_offset++] = (byte) (i >>> 24);
        _buffer[_offset++] = (byte) (i >> 16);
        _buffer[_offset++] = (byte) (i >> 8);
        _buffer[_offset++] = (byte) i;
    }