Mono.Cecil.Metadata.BlobHeap.Read C# (CSharp) Method

Read() public method

public Read ( uint index ) : byte[]
index uint
return byte[]
        public byte[] Read(uint index)
        {
            if (index == 0 || index > this.data.Length - 1)
                return Empty<byte>.Array;

            int position = (int) index;
            int length = (int) data.ReadCompressedUInt32 (ref position);

            if (length > data.Length - position)
                return Empty<byte>.Array;

            var buffer = new byte [length];

            Buffer.BlockCopy (data, position, buffer, 0, length);

            return buffer;
        }