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

WriteBytes() public method

public WriteBytes ( ByteBuffer buffer ) : void
buffer ByteBuffer
return void
        public void WriteBytes(ByteBuffer buffer)
        {
            if (position + buffer.length > this.buffer.Length)
                Grow (buffer.length);

            Buffer.BlockCopy (buffer.buffer, 0, this.buffer, position, buffer.length);
            position += buffer.length;

            if (position > this.length)
                this.length = position;
        }

Same methods

ByteBuffer::WriteBytes ( byte bytes ) : void
ByteBuffer::WriteBytes ( int length ) : void

Usage Example

Esempio n. 1
0
        void PatchRawSection(ByteBuffer buffer, MetadataBuilder metadata)
        {
            var position = base.position;
            Align (4);
            buffer.WriteBytes (base.position - position);

            const byte fat_format = 0x40;
            const byte more_sects = 0x80;

            var flags = ReadByte ();
            if ((flags & fat_format) == 0) {
                buffer.WriteByte (flags);
                PatchRawSmallSection (buffer, metadata);
            } else
                PatchRawFatSection (buffer, metadata);

            if ((flags & more_sects) != 0)
                PatchRawSection (buffer, metadata);
        }
All Usage Examples Of Mono.Cecil.PE.ByteBuffer::WriteBytes