当前位置: 首页>>代码示例>>C#>>正文


C# ImmutableArray.CopyTo方法代码示例

本文整理汇总了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) ? "..." : ""));
        }
开发者ID:kangkot,项目名称:roslyn,代码行数:16,代码来源:EditAndContinueMethodDebugInformation.cs

示例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));
        }
开发者ID:pmlyon,项目名称:BitSharp,代码行数:10,代码来源:NetworkAddressKey.cs

示例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);
        }
开发者ID:kangkot,项目名称:roslyn,代码行数:9,代码来源:BlobWriter.cs

示例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);
        }
开发者ID:gyssels,项目名称:roslyn-Studing-Trying-Things-,代码行数:9,代码来源:BlobWriter.cs

示例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();
        }
开发者ID:Wazner,项目名称:roslyn,代码行数:22,代码来源:LoweredDynamicOperationFactory.cs

示例6: WriteBytes

 internal void WriteBytes(ImmutableArray<byte> buffer, int index, int length)
 {
     int start = Advance(length);
     buffer.CopyTo(index, _buffer, start, length);
 }
开发者ID:GeertVL,项目名称:roslyn,代码行数:5,代码来源:BlobWriter.cs


注:本文中的ImmutableArray.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。