NanoByte.Common
2.7.0
|
A circular buffer represented as a stream that one producer can write to and one consumer can read from simultaneously. More...
Public Member Functions | |
CircularBufferStream (int bufferSize) | |
Creates a new circular buffer. More... | |
override int | Read (byte[] buffer, int offset, int count) |
void | RelayErrorToReader (Exception exception) |
Throws an exception from within Read. More... | |
override void | Write (byte[] buffer, int offset, int count) |
void | DoneWriting () |
Signals that no further calls to Write are intended and any blocked Read calls should return. More... | |
override void | SetLength (long value) |
Sets the estimated number of bytes that will run through this buffer in total; -1 for unknown. More... | |
override long | Seek (long offset, SeekOrigin origin) |
override void | Flush () |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Properties | |
int | BufferSize [get] |
The maximum number of bytes the buffer can hold at any time. More... | |
override bool | CanRead [get] |
override bool | CanWrite [get] |
override bool | CanSeek [get] |
override long | Position [get, set] |
Indicates how many bytes have been read from this buffer so far in total. More... | |
long | PositionWrite [get] |
Indicates how many bytes have been written to this buffer so far in total. More... | |
override long | Length [get] |
The estimated number of bytes that will run through this buffer in total; -1 for unknown. More... | |
bool | IsDisposed [get] |
Indicates that this stream has been closed. More... | |
A circular buffer represented as a stream that one producer can write to and one consumer can read from simultaneously.
Do not use more than one producer or consumer thread simultaneously!
|
inline |
Creates a new circular buffer.
bufferSize | The maximum number of bytes the buffer can hold at any time. |
|
inline |
|
inline |
Throws an exception from within Read.
exception | The exception to throw. |
override void NanoByte.Common.Streams.CircularBufferStream.SetLength | ( | long | value | ) |
Sets the estimated number of bytes that will run through this buffer in total; -1 for unknown.
|
get |
The maximum number of bytes the buffer can hold at any time.
|
get |
Indicates that this stream has been closed.
|
get |
The estimated number of bytes that will run through this buffer in total; -1 for unknown.
|
getset |
Indicates how many bytes have been read from this buffer so far in total.
|
get |
Indicates how many bytes have been written to this buffer so far in total.