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
파일 보기 프로젝트 열기: nano-byte/common 1 사용 예제들

공개 메소드들

메소드 설명
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