C# Class ICSharpCode.SharpZipLib.Tests.TestSupport.ReadWriteRingBuffer

A fixed size buffer of bytes. Both reading and writing are supported. Reading from an empty buffer will wait until data is written. Writing to a full buffer will wait until data is read.
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
Clear ( ) : void

Clear the buffer contents.

Close ( ) : void

Close the buffer for writing.

A Read when the buffer is closed and there is no data will return -1.

Read ( byte buffer, int index, int count ) : int
ReadByte ( ) : int

Read a byte from the buffer.

ReadWriteRingBuffer ( int size ) : System

Create a new RingBuffer with a specified size.

Write ( byte buffer, int index, int count ) : void
WriteByte ( byte value ) : void

Write adds a byte to the head of the RingBuffer.

this ( int index ) : byte

Indexer - Get an element from the tail of the RingBuffer.

Method Details

Clear() public méthode

Clear the buffer contents.
public Clear ( ) : void
Résultat void

Close() public méthode

Close the buffer for writing.
A Read when the buffer is closed and there is no data will return -1.
public Close ( ) : void
Résultat void

Read() public méthode

public Read ( byte buffer, int index, int count ) : int
buffer byte
index int
count int
Résultat int

ReadByte() public méthode

Read a byte from the buffer.
public ReadByte ( ) : int
Résultat int

ReadWriteRingBuffer() public méthode

Create a new RingBuffer with a specified size.
public ReadWriteRingBuffer ( int size ) : System
size int The size of the ring buffer to create.
Résultat System

Write() public méthode

public Write ( byte buffer, int index, int count ) : void
buffer byte
index int
count int
Résultat void

WriteByte() public méthode

Write adds a byte to the head of the RingBuffer.
public WriteByte ( byte value ) : void
value byte The value to add.
Résultat void

this() public méthode

Indexer - Get an element from the tail of the RingBuffer.
public this ( int index ) : byte
index int
Résultat byte