Skip to content
jamesfoster edited this page Feb 3, 2012 · 1 revision

Substream is equivalent to Substring. By specifying the starting position and length you can extract a section of an inner stream.

using(var substream = input.Substream(100, 200))
{
  concatStream.CopyTo(output);
}

If the underlying stream supports seeking it will call Seek, otherwise it will read StartPosition bytes on the first read.

Clone this wiki locally