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.
Mostrar archivo Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method 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 method

Clear the buffer contents.
public Clear ( ) : void
return void

Close() public method

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

Read() public method

public Read ( byte buffer, int index, int count ) : int
buffer byte
index int
count int
return int

ReadByte() public method

Read a byte from the buffer.
public ReadByte ( ) : int
return int

ReadWriteRingBuffer() public method

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

Write() public method

public Write ( byte buffer, int index, int count ) : void
buffer byte
index int
count int
return void

WriteByte() public method

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

this() public method

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