No, you don't have to. For proving that, you can check the constructor code:
public MemoryStream(byte[] buffer, bool writable)
{
if (buffer == null) throw new ArgumentNullException("buffer", Environment.GetResourceString("ArgumentNull_Buffer"));
Contract.EndContractBlock();
_buffer = buffer;
_length = _capacity = buffer.Length;
_writable = writable;
_exposable = false;
_origin = 0;
_isOpen = true;
}
Seek
changes _position
(in your example to 0), which is not assigned in the constructor, so upon construction of the object Position
will have the default long
value of 0
.
It's a different story though if you perform further operations on the stream that could change its Position
before reading from it.