GSF.IO.BinaryStreamBase.InsertBytes C# (CSharp) Method

InsertBytes() public method

Inserts a certain number of bytes into the stream, shifting valid data to the right. The stream's position remains unchanged. (ie. pointing to the beginning of the newly inserted bytes).
Internally this fuction merely acomplishes an Array.Copy(stream,position,stream,position+numberOfBytes,lengthOfValidDataToShift) However, it's much more complicated than this. So this is a pretty useful function. The newly created space is uninitialized.
public InsertBytes ( int numberOfBytes, int lengthOfValidDataToShift ) : void
numberOfBytes int The number of bytes to insert
lengthOfValidDataToShift int The number of bytes that will need to be shifted to perform this insert
return void
        public void InsertBytes(int numberOfBytes, int lengthOfValidDataToShift)
        {
            long pos = Position;
            Copy(Position, Position + numberOfBytes, lengthOfValidDataToShift);
            Position = pos;
        }