internal static ZipIOZip64EndOfCentralDirectoryLocatorBlock CreateNew(ZipIOBlockManager blockManager)
        {
            // This Debug assert is a secondary check in debug builds, callers are responcible for verifying condition
            // in both retail and debug builds
            Debug.Assert(!SniffTheBlockSignature(blockManager));

            ZipIOZip64EndOfCentralDirectoryLocatorBlock block = new ZipIOZip64EndOfCentralDirectoryLocatorBlock(blockManager);

            block._offset    = 0;
            block._size      = 0;
            block._dirtyFlag = false;

            return(block);
        }
        internal static ZipIOZip64EndOfCentralDirectoryLocatorBlock SeekableLoad(ZipIOBlockManager blockManager)
        {
            // This Debug assert is a secondary check in debug builds, callers are responcible for verifying condition
            // in both retail and debug builds
            Debug.Assert(SniffTheBlockSignature(blockManager));

            long blockPosition = checked (blockManager.EndOfCentralDirectoryBlock.Offset - _fixedMinimalRecordSize);

            blockManager.Stream.Seek(blockPosition, SeekOrigin.Begin);

            ZipIOZip64EndOfCentralDirectoryLocatorBlock block = new ZipIOZip64EndOfCentralDirectoryLocatorBlock(blockManager);

            block.ParseRecord(blockManager.BinaryReader, blockPosition);
            return(block);
        }
示例#3
0
        internal static ZipIOZip64EndOfCentralDirectoryBlock SeekableLoad(ZipIOBlockManager blockManager)
        {
            ZipIOZip64EndOfCentralDirectoryLocatorBlock zip64endOfCentralDirectoryLocator =
                blockManager.Zip64EndOfCentralDirectoryLocatorBlock;

            long zip64EndOfCentralDirectoryOffset =
                zip64endOfCentralDirectoryLocator.OffsetOfZip64EndOfCentralDirectoryRecord;

            ZipIOZip64EndOfCentralDirectoryBlock block = new ZipIOZip64EndOfCentralDirectoryBlock(blockManager);

            blockManager.Stream.Seek(zip64EndOfCentralDirectoryOffset, SeekOrigin.Begin);

            block.ParseRecord(blockManager.BinaryReader, zip64EndOfCentralDirectoryOffset);

            return(block);
        }
        internal static ZipIOZip64EndOfCentralDirectoryLocatorBlock CreateNew(ZipIOBlockManager blockManager)          
        {
            // This Debug assert is a secondary check in debug builds, callers are responcible for verifying condition 
            // in both retail and debug builds
            Debug.Assert(!SniffTheBlockSignature(blockManager));

            ZipIOZip64EndOfCentralDirectoryLocatorBlock block = new ZipIOZip64EndOfCentralDirectoryLocatorBlock(blockManager);

            block._offset = 0;
            block._size = 0;
            block._dirtyFlag = false;
            
            return block;
        }
        internal static ZipIOZip64EndOfCentralDirectoryLocatorBlock SeekableLoad (ZipIOBlockManager blockManager)  
        {
            // This Debug assert is a secondary check in debug builds, callers are responcible for verifying condition 
            // in both retail and debug builds
            Debug.Assert(SniffTheBlockSignature(blockManager));
            
            long blockPosition = checked(blockManager.EndOfCentralDirectoryBlock.Offset - _fixedMinimalRecordSize);
            
            blockManager.Stream.Seek(blockPosition, SeekOrigin.Begin);

            ZipIOZip64EndOfCentralDirectoryLocatorBlock block = new ZipIOZip64EndOfCentralDirectoryLocatorBlock(blockManager);
            
            block.ParseRecord(blockManager.BinaryReader, blockPosition);
            return block;
        }