ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream.PartialInputStream C# (CSharp) Method

PartialInputStream() public method

Initialise a new instance of the PartialInputStream class.
public PartialInputStream ( ZipFile zipFile, long start, long length ) : System
zipFile ZipFile The containing the underlying stream to use for IO.
start long The start of the partial data.
length long The length of the partial data.
return System
            public PartialInputStream(ZipFile zipFile, long start, long length) {
                start_=start;
                length_=length;

                // Although this is the only time the zipfile is used
                // keeping a reference here prevents premature closure of
                // this zip file and thus the baseStream_.

                // Code like this will cause apparently random failures depending
                // on the size of the files and when garbage is collected.
                //
                // ZipFile z = new ZipFile (stream);
                // Stream reader = z.GetInputStream(0);
                // uses reader here....
                zipFile_=zipFile;
                baseStream_=zipFile_.baseStream_;
                readPos_=start;
                end_=start+length;
            }