예제 #1
0
            internal ReadOnlySequenceSource(FileBufferingWriter writer, int segmentLength)
            {
                var buffer = writer.buffer;

                tail     = buffer.Memory.Slice(0, writer.position);
                accessor = writer.fileBackend is null ?
                           null :
                           new ReadOnlySequenceAccessor(writer.fileBackend, segmentLength);
                session = writer.EnterReadMode(this);
            }
예제 #2
0
 internal MemoryMappedFileManager(FileBufferingWriter writer, long offset, long length)
 {
     Debug.Assert(length <= int.MaxValue);
     Debug.Assert(writer.fileBackend != null);
     mappedFile = CreateMemoryMappedFile(writer.fileBackend);
     accessor   = mappedFile.CreateViewAccessor(offset, length, MemoryMappedFileAccess.ReadWrite);
     accessor.SafeMemoryMappedViewHandle.AcquirePointer(ref ptr);
     Debug.Assert(ptr != default);
     session = writer.EnterReadMode(this);
     Debug.Assert(writer.IsReading);
 }
예제 #3
0
 internal ReaderStream(FileBufferingWriter writer, bool useAsyncIO)
 {
     writer.GetWrittenContentAsStream(out source, useAsyncIO);
     session = writer.EnterReadMode(this);
 }
 internal ReaderStream(FileBufferingWriter writer)
 {
     writer.GetWrittenContentAsStream(out source);
     session = writer.EnterReadMode(this);
 }