Ejemplo n.º 1
0
        /// <summary>
        /// This constructor is provided to be able to interleave other files than just parts,
        /// notably the contents type file.
        /// </summary>
        internal InterleavedZipPartStream(string partName, List <PieceInfo> sortedPieceInfoList,
                                          FileMode mode, FileAccess access)
        {
            // The PieceDirectory mediates access to pieces.
            // It maps offsets to piece numbers and piece numbers to streams and start offsets.
            // Mode and access are entirely managed by the underlying streams, assumed to be seekable.
            _dir = new PieceDirectory(sortedPieceInfoList, mode, access);

            // GetCurrentPieceNumber is operational from the beginning.
            Invariant.Assert(_dir.GetStartOffset(GetCurrentPieceNumber()) == 0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This constructor is provided to be able to interleave other files than just parts,
        /// notably the contents type file.
        /// </summary>
        internal InterleavedZipPartStream(string partName, List<PieceInfo> sortedPieceInfoList,
            FileMode mode, FileAccess access)
        {
            // The PieceDirectory mediates access to pieces.
            // It maps offsets to piece numbers and piece numbers to streams and start offsets.
            // Mode and access are entirely managed by the underlying streams, assumed to be seekable.
            _dir = new PieceDirectory(sortedPieceInfoList, mode, access);

            // GetCurrentPieceNumber is operational from the beginning.
            Invariant.Assert(_dir.GetStartOffset(GetCurrentPieceNumber()) == 0);
        }