This method implements asynchronous memcpy, if that's available on current hardware

@param dstBuffer
@param srcPointer
@param length
@param dstOffset
967594
@Override
    public void memcpyAsync(DataBuffer dstBuffer, Pointer srcPointer, long length, long dstOffset) {
        //        if (dstBuffer.isConstant()) {
        //            this.memoryHandler.memcpySpecial(dstBuffer, srcPointer, length, dstOffset);
        //        } else
        this.memoryHandler.memcpyAsync(dstBuffer, srcPointer, length, dstOffset);
    }
263618
public static void memcopy(byte[] dest, byte[] src, int copyToIndex) {
		System.arraycopy(src, 0, dest, copyToIndex, src.length);
	}
1100317
public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException {
        Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount);
        if (byteCount == 0) {
            return;
        }
        try {
            while (byteCount > 0) {
                int bytesWritten = Libcore.os.write(fd, bytes, byteOffset, byteCount);
                byteCount -= bytesWritten;
                byteOffset += bytesWritten;
            }
        } catch (ErrnoException errnoException) {
            throw errnoException.rethrowAsIOException();
        }
    }
743266
public int readFrom(ByteBuffer src, long destOffset) {
        if (src.remaining() + destOffset >= size())
            throw new BufferOverflowException();
        int readLen = src.remaining();
        ByteBuffer b = toDirectByteBuffer(destOffset, readLen);
        b.position(0);
        b.put(src);
        return readLen;
    }
580321
public void copyTo(long srcOffset, LBufferAPI dest, long destOffset, long size) {
        unsafe.copyMemory(address() + srcOffset, dest.address() + destOffset, size);
    }
973096
@Override
  public int write(ByteBuffer src) {
    int toTransfer = Math.min(src.remaining(), data.length - offset);
    src.get(data, offset, toTransfer);
    offset += toTransfer;
    return toTransfer;
  }
435343
public final void pinsrd(XMMRegister dst, Register src, Immediate imm8)
  {
    emitX86(INST_PINSRD, dst, src, imm8);
  }
940366
public static void writeToMemory(byte[] src, Object target, long targetOffset) {
    Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET, target, targetOffset, src.length);
  }
1226830
public void writeByteBufferPart(byte[] buffer, int offset, int length)
        throws IOException
    {
        while (length > 0) {
            int sublen = length;

            if (0x8000 < sublen)
                sublen = 0x8000;

            os.write('b');
            os.write(sublen >> 8);
            os.write(sublen);

            os.write(buffer, offset, sublen);

            length -= sublen;
            offset += sublen;
        }
    }
248692
public final static void writeBytesRef(BytesRef src, BytesRef dst) {
    if (src == null) {
      Bytes.writeVInt(dst, 0);
      return;
    }
    Bytes.writeVInt(dst, src.length);
    System.arraycopy(src.bytes, src.offset, dst.bytes, dst.offset, src.length);
    dst.offset += src.length;
  }
80115
public static void memclr( byte[] array, int offset, int length ) {
        for( int i = 0; i < length; ++i, ++offset )
            array[offset] = 0;
    }
172869
public void getBytes(int lengthToCopy, byte[] copyArray, int copyOffset) {
        if (lengthToCopy > 0) {
            System.arraycopy(_buffer, _offset, copyArray, copyOffset, lengthToCopy);
            skip(lengthToCopy);
        }

    }
500625
static void bufferedToPlanar_F32(DataBufferByte buffer, WritableRaster src, Planar<GrayF32> dst) {
		byte[] srcData = buffer.getData();

		int numBands = src.getNumBands();

		int srcStride = stride(src);
		int srcOffset = getOffset(src);

		if(BoofConcurrency.USE_CONCURRENT ) {
			if (numBands == 3) {
				ImplConvertRaster_MT.from_3BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else if (numBands == 1) {
				ImplConvertRaster_MT.from_1BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else if (numBands == 4) {
				ImplConvertRaster_MT.from_4BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else {
				throw new RuntimeException("Write more code here.");
			}
		} else {
			if (numBands == 3) {
				ImplConvertRaster.from_3BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else if (numBands == 1) {
				ImplConvertRaster.from_1BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else if (numBands == 4) {
				ImplConvertRaster.from_4BU8_to_PLF32(srcData, srcStride, srcOffset, dst);
			} else {
				throw new RuntimeException("Write more code here.");
			}
		}
	}
1027643
public int writeTo(ByteBuffer bb) throws IOException
    {
        return writeTo((srcs, offset, len)->ByteBuffers.move(srcs, offset, len, bb), writeToSplitter);
    }
224764
public static int copyWsByteBuffer(WsByteBuffer src, WsByteBuffer dst, int amount)
   {
      int amountCopied = amount;
      int dstRemaining = dst.remaining();
      int srcRemaining = src.remaining();

      if (amountCopied > dstRemaining) amountCopied = dstRemaining;
      if (amountCopied > srcRemaining) amountCopied = srcRemaining;

      if (amountCopied > 0)
      {
         int srcLimit = src.limit();
         src.limit(src.position()+amountCopied);
         dst.put(src);
         src.limit(srcLimit);
      }

      return amountCopied;
   }
1048247
public static void setBytes(long address, byte[] buffer, int bufferOffset, int count)
    {
        assert buffer != null;
        assert !(bufferOffset < 0 || count < 0 || bufferOffset + count > buffer.length);
        setBytes(buffer, bufferOffset, address, count);
    }
249306
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;
        SMBUtil.writeInt2(49, dst, dstIndex);
        int dataOffsetOffset = dstIndex + 2;
        dstIndex += 4;
        SMBUtil.writeInt4(this.dataLength, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt8(this.offset, dst, dstIndex);
        dstIndex += 8;
        System.arraycopy(this.fileId, 0, dst, dstIndex, 16);
        dstIndex += 16;
        SMBUtil.writeInt4(this.channel, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt4(this.remainingBytes, dst, dstIndex);
        dstIndex += 4;

        SMBUtil.writeInt2(0, dst, dstIndex); // writeChannelInfoOffset
        SMBUtil.writeInt2(0, dst, dstIndex + 2); // writeChannelInfoLength
        dstIndex += 4;

        SMBUtil.writeInt4(this.writeFlags, dst, dstIndex);
        dstIndex += 4;

        SMBUtil.writeInt2(dstIndex - getHeaderStart(), dst, dataOffsetOffset);

        if ( dstIndex + this.dataLength > dst.length ) {
            throw new IllegalArgumentException(
                String.format("Data exceeds buffer size ( remain buffer: %d data length: %d)", dst.length - dstIndex, this.dataLength));
        }

        System.arraycopy(this.data, this.dataOffset, dst, dstIndex, this.dataLength);
        dstIndex += this.dataLength;
        return dstIndex - start;
    }