A stream that provides only readonly funcionality.
More...
|
| | ReadOnlyStream (Stream stream) |
| | Creates a new readonly instance of a stream.
|
| |
| override void | Flush () |
| | Flushes what was written to the stream.
|
| |
| override int | Read (byte[] buffer, int offset, int count) |
| | Reads a sequence of bytes from the stream into a buffer.
|
| |
| override long | Seek (long offset, SeekOrigin origin) |
| | Changes the current position within the stream.
|
| |
| override void | SetLength (long value) |
| | Changes the length of the stream.
|
| |
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes to the stream.
|
| |
| override IAsyncResult | BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state) |
| | Writes to the stream asynchronously.
|
| |
| override void | EndWrite (IAsyncResult asyncResult) |
| | Ends writing to the stream asynchrounously.
|
| |
| override void | WriteByte (byte value) |
| | Writes a single byte to the stream.
|
| |
| override Task | WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) |
| | Writes to the stream asynchronously.
|
| |
| override Task | FlushAsync (CancellationToken cancellationToken) |
| | Flushes the write buffer of the stream.
|
| |
| override void | Close () |
| | Closes the stream preventing further use of it.
|
| |
|
| override void | Dispose (bool disposing) |
| | Disposes of resources used by the stream.
|
| |
| void | CheckIfStreamIsClosed () |
| | Checks if the stream is already closed.
|
| |
|
| override bool | CanRead [get] |
| | Checks if the stream can be read.
|
| |
| override bool | CanSeek [get] |
| | Checks if it is possible to seek in the stream or if it can only be read in sequence.
|
| |
| override bool | CanWrite [get] |
| | Checks if the stream is writable.
|
| |
| override long | Length [get] |
| | Checks the length of the stream.
|
| |
| override long | Position [get, set] |
| | Checks or sets the current position in the stream.
|
| |
A stream that provides only readonly funcionality.
- Since
- 0.5.0
◆ ReadOnlyStream()
| Joutsen.IO.ReadOnlyStream.ReadOnlyStream |
( |
Stream |
stream | ) |
|
Creates a new readonly instance of a stream.
◆ BeginWrite()
| override IAsyncResult Joutsen.IO.ReadOnlyStream.BeginWrite |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count, |
|
|
AsyncCallback |
callback, |
|
|
object |
state |
|
) |
| |
Writes to the stream asynchronously.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ CheckIfStreamIsClosed()
| void Joutsen.IO.ReadOnlyStream.CheckIfStreamIsClosed |
( |
| ) |
|
|
protected |
Checks if the stream is already closed.
- Exceptions
-
| IOException | if the stream is closed |
◆ Close()
| override void Joutsen.IO.ReadOnlyStream.Close |
( |
| ) |
|
Closes the stream preventing further use of it.
◆ Dispose()
| override void Joutsen.IO.ReadOnlyStream.Dispose |
( |
bool |
disposing | ) |
|
|
protected |
Disposes of resources used by the stream.
This also closes the stream.
◆ EndWrite()
| override void Joutsen.IO.ReadOnlyStream.EndWrite |
( |
IAsyncResult |
asyncResult | ) |
|
Ends writing to the stream asynchrounously.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ Flush()
| override void Joutsen.IO.ReadOnlyStream.Flush |
( |
| ) |
|
Flushes what was written to the stream.
This operation is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ FlushAsync()
| override Task Joutsen.IO.ReadOnlyStream.FlushAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Flushes the write buffer of the stream.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ Read()
| override int Joutsen.IO.ReadOnlyStream.Read |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count |
|
) |
| |
Reads a sequence of bytes from the stream into a buffer.
- Parameters
-
| buffer | the buffer |
| offset | the start offset of the buffer |
| count | the maximum number of bytes to read |
- Returns
- the actual number of bytes read
- Exceptions
-
| IOException | if the stream is closed |
◆ Seek()
| override long Joutsen.IO.ReadOnlyStream.Seek |
( |
long |
offset, |
|
|
SeekOrigin |
origin |
|
) |
| |
Changes the current position within the stream.
- Parameters
-
| offset | the new position in the stream |
| origin | the way to interpret the offset, from the beginning, end or current position |
- Returns
- the new position
- Exceptions
-
| IOException | if the stream is closed |
◆ SetLength()
| override void Joutsen.IO.ReadOnlyStream.SetLength |
( |
long |
value | ) |
|
Changes the length of the stream.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ Write()
| override void Joutsen.IO.ReadOnlyStream.Write |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count |
|
) |
| |
Writes to the stream.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ WriteAsync()
| override Task Joutsen.IO.ReadOnlyStream.WriteAsync |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count, |
|
|
CancellationToken |
cancellationToken |
|
) |
| |
Writes to the stream asynchronously.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ WriteByte()
| override void Joutsen.IO.ReadOnlyStream.WriteByte |
( |
byte |
value | ) |
|
Writes a single byte to the stream.
This method is not supported.
- Exceptions
-
| NotSupportedException | whenever the method is called |
◆ CanRead
| override bool Joutsen.IO.ReadOnlyStream.CanRead |
|
get |
Checks if the stream can be read.
◆ CanSeek
| override bool Joutsen.IO.ReadOnlyStream.CanSeek |
|
get |
Checks if it is possible to seek in the stream or if it can only be read in sequence.
◆ CanWrite
| override bool Joutsen.IO.ReadOnlyStream.CanWrite |
|
get |
Checks if the stream is writable.
This is always fals.
◆ Length
| override long Joutsen.IO.ReadOnlyStream.Length |
|
get |
Checks the length of the stream.
- Exceptions
-
| IOException | if the stream is closed |
◆ Position
| override long Joutsen.IO.ReadOnlyStream.Position |
|
getset |
Checks or sets the current position in the stream.
- Exceptions
-
| IOException | if the stream is closed |