Writes the stream contents to a byte array, regardless of the Position property.
This may fail if there is not enough contiguous memory available to hold current size of stream. When possible use methods which operate on streams directly instead.
Cannot create a byte array with more than 2,147,483,591 elements. The stream is closed.