C# Класс NanoByte.Common.Streams.CircularBufferStream

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!
Наследование: Stream
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CircularBufferStream ( int bufferSize ) : System

Creates a new circular buffer.

DoneWriting ( ) : void

Signals that no further calls to Write are intended and any blocked Read calls should return.

Flush ( ) : void
Read ( byte buffer, int offset, int count ) : int
RelayErrorToReader ( Exception exception ) : void

Throws an exception from within Read.

Seek ( long offset, SeekOrigin origin ) : long
SetLength ( long value ) : void

Sets the estimated number of bytes that will run through this buffer in total; -1 for unknown.

Write ( byte buffer, int offset, int count ) : void

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Описание методов

CircularBufferStream() публичный Метод

Creates a new circular buffer.
public CircularBufferStream ( int bufferSize ) : System
bufferSize int The maximum number of bytes the buffer can hold at any time.
Результат System

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

DoneWriting() публичный Метод

Signals that no further calls to Write are intended and any blocked Read calls should return.
public DoneWriting ( ) : void
Результат void

Flush() публичный Метод

public Flush ( ) : void
Результат void

Read() публичный Метод

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
Результат int

RelayErrorToReader() публичный Метод

Throws an exception from within Read.
public RelayErrorToReader ( Exception exception ) : void
exception System.Exception The exception to throw.
Результат void

Seek() публичный Метод

public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
Результат long

SetLength() публичный Метод

Sets the estimated number of bytes that will run through this buffer in total; -1 for unknown.
public SetLength ( long value ) : void
value long
Результат void

Write() публичный Метод

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
Результат void