Get bytes from the xdr buffer to the input buffer

@param lengthToCopy
Number of bytes to copy.
@param copyArray
Array to hold the copied data.
@param copyOffset
Where to start the copy.
172869
public void getBytes(int lengthToCopy, byte[] copyArray, int copyOffset) {
        if (lengthToCopy > 0) {
            System.arraycopy(_buffer, _offset, copyArray, copyOffset, lengthToCopy);
            skip(lengthToCopy);
        }

    }
1214395
public static void copyMemory(final Object src, long srcOffset, final Object dest,
      final long destOffset, final long len) {

    // TODO make this work if destOffset is not STRIDE aligned
    Preconditions.checkNotNull(src);
    Preconditions.checkArgument(len % COPY_STRIDE != 0, "Length (%d) is not a multiple of stride", len);

    Preconditions.checkArgument(destOffset % COPY_STRIDE != 0,
        "Dest offset (%d) is not stride aligned", destOffset);

    long end = destOffset + len;
    for (long offset = destOffset; offset < end; ) {
      unsafe.putLong(dest, offset, unsafe.getLong(srcOffset));
      offset += COPY_STRIDE;
      srcOffset += COPY_STRIDE;
    }
  }
789623
public void writeByteBufferPart(byte[] buffer, int offset, int length)
        throws IOException
    {
        while (length > 0) {
            flushIfFull();

            int sublen = _buffer.length - _offset;

            if (length < sublen)
                sublen = length;

            _buffer[_offset++] = BC_BINARY_CHUNK;
            _buffer[_offset++] = (byte) (sublen >> 8);
            _buffer[_offset++] = (byte) sublen;

            System.arraycopy(buffer, offset, _buffer, _offset, sublen);

            _offset += sublen;
            length -= sublen;
            offset += sublen;
        }
    }
807523
public int copyTo(byte[] dest, int start)
      throws BufferTooSmallException {
    if (size > (dest.length - start)) {
      throw new BufferTooSmallException("size is " + size
          + ", buffer availabe size is " + (dest.length - start));
    }
    if (size > 0) {
      System.arraycopy(bytes, 0, dest, start, size);
    }
    return size;
  }
1277775
public static Object copy(Object src, Object dest, int length) {
		System.arraycopy(src, 0, dest, 0, length);
		return dest;
	}
1244186
public static ByteBuffer copy(ByteBuffer src, int srcStart, ByteBuffer dest, int destStart, int length) {
		System.arraycopy(src.array(), srcStart, dest.array(), destStart, length);
		return dest;
	}
489924
public static final Bytes of(byte[] data, int offset, int length) {
    Objects.requireNonNull(data);
    if (length == 0) {
      return EMPTY;
    }
    byte[] copy = new byte[length];
    System.arraycopy(data, offset, copy, 0, length);
    return new Bytes(copy);
  }
692748
public static void copyArray(Object source, Object dest, int count) {
        System.arraycopy(source, 0, dest, 0, count);
    }
702898
final ByteBuffer copyPointer(int index) {
    ByteBuffer pointer = readPointer(index);
    // Making a copy for so that someone can modify the underlying impl
    ByteBuffer result = ByteBuffer.allocate(pointer.capacity());
    result.put(pointer);
    result.flip();
    return result;
  }
774000
private void copyToStrBuffer(byte[] buffer, int offset, int length) {
    Preconditions.checkArgument(length >= 0);
    if (strBuffer.length - strBufferIndex < length) {
      // cannot fit, expanding buffer
      expandStrBuffer(length);
    }
    System.arraycopy(
      buffer, offset, strBuffer, strBufferIndex, Math.min(length, MAX_ALLOWABLE_BUFFER_SIZE - strBufferIndex));
    strBufferIndex += length;
  }
880482
public static byte[] duplicateByteArray(byte[] in, int offset, int length)
    {
        if (in == null) return null;

        byte[] out =  new byte[length];
        System.arraycopy(in, offset, out, 0, length);

        return out;
    }
76935
public void write(final byte[] srcBytes, final int srcOffset, final int length)
    {
        buffer.putBytes(offset + position, srcBytes, srcOffset, length);
        position += length;
    }
666228
@Override
  public void write(byte []buffer, int offset, int length)
  {
    if (isClosed() || isHead()) {
      return;
    }

    int byteLength = _offset;
    
    while (true) {
      int sublen = Math.min(length, SIZE - byteLength);

      System.arraycopy(buffer, offset, _buffer, byteLength, sublen);
      offset += sublen;
      length -= sublen;
      byteLength += sublen;
      
      if (length <= 0) {
        break;
      }
      
      _offset = byteLength;
      flushByteBuffer();
      byteLength = _offset;
    }

    _offset = byteLength;
  }
200139
public void setBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
    {
        if (buffer == null)
            throw new NullPointerException();
        else if (bufferOffset < 0
                 || count < 0
                 || bufferOffset + count > buffer.length)
            throw new IndexOutOfBoundsException();
        else if (count == 0)
            return;

        long end = memoryOffset + count;
        checkBounds(memoryOffset, end);

        unsafe.copyMemory(buffer, BYTE_ARRAY_BASE_OFFSET + bufferOffset, null, peer + memoryOffset, count);
    }
1115349
public static ByteBuffer copy(ByteBuffer src, ByteBuffer dest, int length) {
		return copy(src, src.position(), dest, dest.position(), length);
	}
443925
public void set(byte[] newData, int offset, int length) {
    setSize(0);
    setSize(length);
    System.arraycopy(newData, offset, bytes, 0, size);
  }
729651
public static byte[] copyOf(byte[] byteArray) {

    	byte[] copy = new byte[byteArray.length];
        System.arraycopy(byteArray, 0, copy, 0, byteArray.length);
        return copy;
    }