Closes the stream, storing the length for later use.
Initializes a new instance of the RepairedMemoryStream class.