PartialReadOnlyStream
Namespace: SnowBank.IO · class
Implements: Stream, IDisposable, IAsyncDisposable
Stream that exposes a readonly-only subsection of another stream Stream.
Constructors
PartialReadOnlyStream
PartialReadOnlyStream(Stream fs, long offset, long length, bool ownsStream)
Properties
CanRead
bool CanRead { get; }
CanSeek
bool CanSeek { get; }
CanTimeout
bool CanTimeout { get; }
CanWrite
bool CanWrite { get; }
InnerPosition
long? InnerPosition { get; }
Mapped position in the inner stream (for debugging purpose only)
Length
long Length { get; }
Position
long Position { get; set; }
ReadTimeout
int ReadTimeout { get; set; }
Remaining
long? Remaining { get; }
Number of bytes reamining before the end of this stream
WriteTimeout
int WriteTimeout { get; set; }
Methods
DisposeAsync
ValueTask DisposeAsync()
Flush
void Flush()
FlushAsync
Task FlushAsync(CancellationToken cancellationToken)
Read
int Read(Span<byte> buffer)
int Read(byte[] buffer, int offset, int count)
ReadAsync
ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = null)
Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
ReadByte
int ReadByte()
Seek
long Seek(long offset, SeekOrigin origin)
SetLength
void SetLength(long value)
Write
void Write(ReadOnlySpan<byte> buffer)
void Write(byte[] buffer, int offset, int count)
WriteAsync
ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = null)
Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
WriteByte
void WriteByte(byte value)