public static BlockTableEntry FromReader(BinaryReader reader) { var ret = new BlockTableEntry { DirectoryOffset = reader.ReadInt64(), BlockSize = reader.ReadInt64() }; return(ret); }
private Stream ReadBlockData(BlockTableEntry fileBlock, bool raw = false) { var ret = (Stream)SourceFile.CreateViewStream(fileBlock.DirectoryOffset, fileBlock.BlockSize, MemoryMappedFileAccess.Read); if (!raw) { if (Deflate) { ret = new DeflateStream(ret, CompressionMode.Decompress, false); } if (Rar) { byte[] properties = new byte[5]; ret = new BufferedStream(ret, 16777216); ret.Read(properties, 0, properties.Length); ret = new LzmaStream(properties, ret, ret.Length - properties.Length, UncompressedSize, null, false); } } return(ret); }