Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
How to remove bytes from MemoryStream

Unanswered How to remove bytes from MemoryStream

  • mercredi 4 février 2009 01:15
     
      A du code
    I'm reading binary data into a MemoryStream object and every so often, I'd like to chomp off all the bytes before MemoryStream.Position (effectively setting the current position as the beginning of the stream).  I'd like to do this in order to allow the memory to be freed.  These will be long lived objects, accumulating lots of data, hence it is necessary to "trim" it every once in a while.

    Thanks in advance for the help!