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

RemoveBytes() public method

Removes a certain number of bytes from the stream, shifting valid data after this location to the left. The stream's position remains unchanged. (ie. pointing to where the data used to exist).
Internally this fuction merely acomplishes an Array.Copy(stream,position+numberOfBytes,stream,position,lengthOfValidDataToShift) However, it's much more complicated than this. So this is a pretty useful function. The space at the end of the copy is uninitialized.
public RemoveBytes ( int numberOfBytes, int lengthOfValidDataToShift ) : void
numberOfBytes int The distance to shift. Positive means shifting to the right (ie. inserting data) /// Negative means shift to the left (ie. deleteing data)
lengthOfValidDataToShift int The number of bytes that will need to be shifted to perform the remove. /// This only includes the data that is valid after the shift is complete, and not the data that will be removed.
return void
        public void RemoveBytes(int numberOfBytes, int lengthOfValidDataToShift)
        {
            long pos = Position;
            Copy(Position + numberOfBytes, Position, lengthOfValidDataToShift);
            Position = pos;
        }