本文整理汇总了C#中ImmutableArray.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableArray.CopyTo方法的具体用法?C# ImmutableArray.CopyTo怎么用?C# ImmutableArray.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableArray
的用法示例。
在下文中一共展示了ImmutableArray.CopyTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateInvalidDataException
private static InvalidDataException CreateInvalidDataException(ImmutableArray<byte> data, int offset)
{
const int maxReportedLength = 1024;
int start = Math.Max(0, offset - maxReportedLength / 2);
int end = Math.Min(data.Length, offset + maxReportedLength / 2);
byte[] left = new byte[offset - start];
data.CopyTo(start, left, 0, left.Length);
byte[] right = new byte[end - offset];
data.CopyTo(offset, right, 0, right.Length);
throw new InvalidDataException(string.Format(CodeAnalysisResources.InvalidDataAtOffset,
offset, (start != 0) ? "..." : "", BitConverter.ToString(left), BitConverter.ToString(right), (end != data.Length) ? "..." : ""));
}
示例2: NetworkAddressKey
public NetworkAddressKey(ImmutableArray<byte> IPv6Address, UInt16 Port)
{
this.IPv6Address = IPv6Address;
this.Port = Port;
var hashBytes = new byte[2 + IPv6Address.Length];
Bits.EncodeUInt16(Port, hashBytes);
IPv6Address.CopyTo(hashBytes, 2);
hashCode = Bits.ToInt32(new xxHash(32).ComputeHash(hashBytes));
}
示例3: Write
internal void Write(ImmutableArray<byte> buffer, int index, int length)
{
int position = (int)_position;
// resize, if needed
this.Position += (uint)length;
buffer.CopyTo(index, this.Buffer, position, length);
}
示例4: Write
internal void Write(ImmutableArray<byte> buffer, int index, int length)
{
int start = _position;
// resize, if needed
Position += length;
buffer.CopyTo(index, _buffer, start, length);
}
示例5: GetCallSiteArguments
internal static ImmutableArray<BoundExpression> GetCallSiteArguments(BoundExpression callSiteFieldAccess, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, BoundExpression right)
{
var result = new BoundExpression[1 + (receiver != null ? 1 : 0) + arguments.Length + (right != null ? 1 : 0)];
int j = 0;
result[j++] = callSiteFieldAccess;
if (receiver != null)
{
result[j++] = receiver;
}
arguments.CopyTo(result, j);
j += arguments.Length;
if (right != null)
{
result[j++] = right;
}
return result.AsImmutableOrNull();
}
示例6: WriteBytes
internal void WriteBytes(ImmutableArray<byte> buffer, int index, int length)
{
int start = Advance(length);
buffer.CopyTo(index, _buffer, start, length);
}