StreamUtility.CreatePartialStream method

Uses RebasedStream and/or TruncatedStream to create a read-only partial stream wrapper.

public static Stream CreatePartialStream(Stream stream, long offset, long? length, 
    Ownership ownership)
parameter description
stream The stream to wrap.
offset The desired offset into the wrapped stream, which is immediately seeked to that position.
length The desired length of the partial stream (optional).
ownership Indicates the ownership of the wrapped stream.

Return Value

The read-only partial stream wrapper.

Remarks

If offset is zero and length is null, the stream is returned unwrapped.

See Also