Ejemplo n.º 1
0
        public Stream OpenStream(long offset, long size)
        {
            int  segmentIdx    = GetSegmentFromVirtualOffset(offset);
            long segmentOffset = GetOffsetFromVirtualOffset(offset);

            if (segmentIdx > Segments.Length)
            {
                throw new ArgumentOutOfRangeException(nameof(offset));
            }

            RemapSegment segment = Segments[GetSegmentFromVirtualOffset(offset)];

            if (segmentOffset > segment.Length)
            {
                throw new ArgumentOutOfRangeException(nameof(offset));
            }

            Stream stream = new RemapStream(StreamSource.CreateStream(), segment);

            return(new SubStream(stream, offset, size));
        }
Ejemplo n.º 2
0
 private AllocationTableStream OpenFatBlock(int blockIndex, long size)
 {
     return(new AllocationTableStream(StreamSource.CreateStream(), AllocationTable, (int)Header.BlockSize, blockIndex, size));
 }
Ejemplo n.º 3
0
 public Stream OpenRawSaveFs() => StreamSource.CreateStream();
Ejemplo n.º 4
0
 public Stream OpenSection()
 {
     return(StreamSource.CreateStream(FileOffset, CompressedSize));
 }