|
Enhanced C#
Loyc library documentation
|
An implementation of IScanner{T} that reads from a Stream. More...
An implementation of IScanner{T} that reads from a Stream.
This class assumes that no other code will seek/read/write in the stream while this class is using it. It does not require CanSeek to be true on the stream, but if it is, then CanScanBackward will be true, and Position will be fully functional.
Public fields | |
| bool | CanScanBackward => _stream.CanSeek |
Properties | |
| int | MinBlockSize [get, set] |
| The minimum amount of data to read from the stream at once. More... | |
| long | Position [get, set] |
| Gets or sets the stream's Position. If the stream is not seekable, the getter returns the position relative to the stream position when this object was constructed, and the setter cannot be used. More... | |
Public Member Functions | |
| StreamScanner (Stream stream, int minBlockSize=0x10000, bool disposeStream=true) | |
| ReadOnlyMemory< byte > | Read (int skip, int minLength, ref Memory< byte > buffer) |
| void | Dispose () |
Static Public Member Functions | |
| static StreamScanner | OpenFile (string path, int minBlockSize=0x10000, FileShare share=FileShare.Read) |
| Opens a file and returns a StreamScanner representing it. More... | |
Protected fields | |
| Stream | _stream |
| bool | _disposeStream |
|
inlinestatic |
Opens a file and returns a StreamScanner representing it.
|
getset |
The minimum amount of data to read from the stream at once.
|
getset |
Gets or sets the stream's Position. If the stream is not seekable, the getter returns the position relative to the stream position when this object was constructed, and the setter cannot be used.
1.8.7