BoundedStream Constructor

Initialize a new instance of the BoundedStream class.

Definition

Namespace: MimeKit.IO
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public BoundedStream(
	Stream baseStream,
	long startBoundary,
	long endBoundary,
	bool leaveOpen
)

Parameters

baseStream  Stream
The underlying stream.
startBoundary  Int64
The offset in the base stream that will mark the start of this substream.
endBoundary  Int64
The offset in the base stream that will mark the end of this substream.
leaveOpen  Boolean
to leave the baseStream open after the BoundedStream is disposed; otherwise, .

Remarks

If the endBoundary is less than 0, then the end of the stream is unbounded.

Exceptions

ArgumentNullException baseStream is .
ArgumentOutOfRangeException

startBoundary is less than zero.

-or-

endBoundary is greater than or equal to zero -and- is less than startBoundary.

See Also