Class LazyFileStream
- Namespace
- Yarhl.IO.StreamFormat
- Assembly
- Yarhl.dll
Open file for reading or writing on the first operation (lazily).
public sealed class LazyFileStream : StreamWrapper, IAsyncDisposable, IDisposable
- Inheritance
-
LazyFileStream
- Implements
- Inherited Members
Constructors
LazyFileStream(string, FileOpenMode)
Initializes a new instance of the LazyFileStream class.
public LazyFileStream(string path, FileOpenMode mode)
Parameters
path
stringPath to the file.
mode
FileOpenModeMode to open the file.
Properties
Length
Gets the length of this stream.
public override long Length { get; }
Property Value
Position
Gets or sets the position from the start of this stream.
public override long Position { get; set; }
Property Value
Methods
Read(byte[], int, int)
Reads from the stream to the buffer.
public override int Read(byte[] buffer, int offset, int count)
Parameters
buffer
byte[]Buffer to copy data.
offset
intIndex to start copying in buffer.
count
intNumber of bytes to read.
Returns
- int
The number of bytes read.
ReadByte()
Reads the next byte.
public override int ReadByte()
Returns
- int
The next byte.
SetLength(long)
Sets the length of the stream.
public override void SetLength(long value)
Parameters
value
longThe new length of the stream.
Write(byte[], int, int)
Writes the a portion of the buffer to the stream.
public override void Write(byte[] buffer, int offset, int count)
Parameters
WriteByte(byte)
Writes a byte.
public override void WriteByte(byte value)
Parameters
value
byteByte value.