Write the provided pointer at the specified index.
(Assumes limit on buffer is correctly set)
(Position of the buffer changed)
554630
private void writePointer(int index, ByteBuffer pointer) {
    int limit = memoryBuffer.limit();
    int pos = memoryBuffer.position();
    int pointerOffset = computePointerOffset(index);
    memoryBuffer.limit(pointerOffset + POINTER_SIZE_BYTES);
    memoryBuffer.position(pointerOffset);
    memoryBuffer.put(pointer);
    memoryBuffer.limit(limit);
    memoryBuffer.position(pos);
  }
1344517
public void write(final int b)
    {
        if (position == length)
        {
            throw new IllegalStateException("position has reached the end of underlying buffer");
        }

        buffer.putByte(offset + position, (byte)b);
        ++position;
    }
1210969
public void setReadPosition(long pointer) {
		final int bufferNum = (int) (pointer >>> this.segmentSizeBits);
		final int offset = (int) (pointer & (this.memorySegmentSize - 1));
		
		this.currentBufferNum = bufferNum;
		seekInput(this.partitionBuffers[bufferNum], offset,
					bufferNum < this.partitionBuffers.length-1 ? this.memorySegmentSize : this.finalBufferLimit);
		
	}
195009
public void write(char buf[], int off, int len) {
        try {
            synchronized (lock) {
                ensureOpen();
                out.write(buf, off, len);
            }
        }
        catch (InterruptedIOException x) {
            Thread.currentThread().interrupt();
        }
        catch (IOException x) {
            trouble = true;
        }
    }
766933
public void writeRawBytes(final byte[] value, int offset, int length)
                            throws IOException {
    if (limit - position >= length) {
      // We have room in the current buffer.
      System.arraycopy(value, offset, buffer, position, length);
      position += length;
    } else {
      // Write extends past current buffer.  Fill the rest of this buffer and
      // flush.
      final int bytesWritten = limit - position;
      System.arraycopy(value, offset, buffer, position, bytesWritten);
      offset += bytesWritten;
      length -= bytesWritten;
      position = limit;
      refreshBuffer();

      // Now deal with the rest.
      // Since we have an output stream, this is our buffer
      // and buffer offset == 0
      if (length <= limit) {
        // Fits in new buffer.
        System.arraycopy(value, offset, buffer, 0, length);
        position = length;
      } else {
        // Write is very big.  Let's do it all at once.
        output.write(value, offset, length);
      }
    }
  }
1336031
private void recordIndex(int index) {
        stateLock.writeLock().lock();
        try {
            int insertionPoint = -Arrays.binarySearch(effectiveIndex, index) - 1;
            System.arraycopy(effectiveIndex, insertionPoint, effectiveIndex, insertionPoint + 1, effectiveIndex.length - insertionPoint - 1);
            effectiveIndex[insertionPoint] = index;
        } finally {
            stateLock.writeLock().unlock();
        }
    }
1161512
public void write(ByteBuffer buffer, int len) {
        if (len < 1) return;
        if (count >= content.length - len) {
            byte[] ns = new byte[content.length + len];
            System.arraycopy(content, 0, ns, 0, count);
            this.content = ns;
        }
        buffer.get(content, count, len);
        count += len;
    }
740743
public void write(byte[] b, int off, int len) throws IOException
	{
		if (b == null)
			throw new NullPointerException();
		if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length)
			|| ((off + len) < 0))
			throw new IndexOutOfBoundsException();
		p.writeBytes(b, off, len);
	}
739997
public void write(byte[] bytes, int offset, int len)
    {
        if (bytes == null)
        {
            return;
        }
        if ((offset < 0) || (offset > bytes.length) || (len < 0) || ((offset + len) - bytes.length > 0))
        {
            throw new IndexOutOfBoundsException("offset=" + offset + ", len=" + len + ", bytes.length=" + bytes.length);
        }
        ensureCapacity(size + len);
        System.arraycopy(bytes, offset, buffer, size, len);
        size += len;
    }
275404
final ByteBuffer readPointer(int index) {
    int pointerOffset = computePointerOffset(index);
    return sliceOutRange(pointerOffset, pointerOffset + POINTER_SIZE_BYTES);
  }
244022
public void write(byte[] b,int offset, int length)
        throws IOException
    {
        ensureSpareCapacity(length);
        System.arraycopy(b,offset,_buf,_pos,length);
        _pos+=length;
    }
372739
public void writeByteCurrentPosition(byte v) throws IOException {
    int index = (int)(position - bufferOffset);
    if (index < maxBufferSize) {
      buffer[index] = v;
      isByte[index] = true;
      if (index + 1 > currentBufferSize) currentBufferSize = index + 1;
      if (index + 1 >= maxBufferSize) {
        writeBuffer();
        newBuffer(position + 1);
      }
    } else {
      aFile.write(v);
    }
    position++;
  }
110429
@Override
    public synchronized void write(final byte[] b, final int off, final int len) {
        if (off < 0 || off > b.length || len < 0 || off + len - b.length > 0) {
            throw new IndexOutOfBoundsException();
        }
        ensureCapacity(super.count + len);
        System.arraycopy(b, off, super.buf, super.count, len);
        super.count += len;
    }
1142487
private void moveDataAfterIndex(int index, int length) {
		ensureCapacity(Math.max(this.position, index) + length);
		if (index < this.position) {
			// 插入位置在已有数据范围内，后移插入位置之后的数据
			System.arraycopy(this.value, index, this.value, index + length, this.position - index);
		} else if (index > this.position) {
			// 插入位置超出范围，则当前位置到index清除为空格
			Arrays.fill(this.value, this.position, index, StrUtil.C_SPACE);
		}
		// 不位移
	}
201776
def memory_write(self, start_position: int, size: int, value: bytes) -> None:
        
        return self._memory.write(start_position, size, value)
500630
public void write(ByteArrayBuffer buf) {
        data.copy(buf.data, 0, pointer, buf.length());
        pointer += buf.length();
    }
278059
function setRef (buffer, offset, value) {
  debug('Array reference "type" setter for buffer at offset', offset)
  var ptr
  if (value instanceof this) {
    ptr = value.buffer
  } else {
    ptr = new this(value).buffer
  }
  _ref.writePointer(buffer, offset, ptr)
}