Mono.Cecil.PE.ByteBuffer.ReadBytes C# (CSharp) Method

ReadBytes() public method

public ReadBytes ( int length ) : byte[]
length int
return byte[]
        public byte[] ReadBytes(int length)
        {
            var bytes = new byte [length];
            Buffer.BlockCopy (buffer, position, bytes, 0, length);
            position += length;
            return bytes;
        }

Usage Example

Beispiel #1
0
        private void ReadPdbHeap()
        {
            PdbHeap    pdbHeap    = image.PdbHeap;
            ByteBuffer byteBuffer = new ByteBuffer(pdbHeap.data);

            pdbHeap.Id                  = byteBuffer.ReadBytes(20);
            pdbHeap.EntryPoint          = byteBuffer.ReadUInt32();
            pdbHeap.TypeSystemTables    = byteBuffer.ReadInt64();
            pdbHeap.TypeSystemTableRows = new uint[58];
            for (int i = 0; i < 58; i++)
            {
                Table table = (Table)i;
                if (pdbHeap.HasTable(table))
                {
                    pdbHeap.TypeSystemTableRows[i] = byteBuffer.ReadUInt32();
                }
            }
        }
All Usage Examples Of Mono.Cecil.PE.ByteBuffer::ReadBytes