Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

UnsafeBitArray.Copy

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void Copy(int dstPos, int srcPos, int numBits);

Parameters

Parameter Description
dstPos Index of the first bit to set.
srcPos Index of the first bit to copy.
numBits Number of bits to copy.

Description

Copies a range of bits from this array to another range in this array.

The bits to copy run from index srcPos up to (but not including) srcPos + numBits. The bits to set run from index dstPos up to (but not including) dstPos + numBits.

The ranges may overlap, but the result in the overlapping region is undefined.


Declaration

public void Copy(int dstPos, ref UnsafeBitArray srcBitArray, int srcPos, int numBits);

Parameters

Parameter Description
dstPos Index of the first bit to set.
srcBitArray The source array.
srcPos Index of the first bit to copy.
numBits The number of bits to copy.

Description

Copies a range of bits from an array to a range of bits in this array.

The bits to copy in the source array run from index srcPos up to (but not including) srcPos + numBits. The bits to set in the destination array run from index dstPos up to (but not including) dstPos + numBits.

It's fine if source and destination array are one and the same, even if the ranges overlap, but the result in the overlapping region is undefined.