C# Class Journaler.ByteRingBuffer

A circular ring buffer of bytes
Afficher le fichier Open project: odeheurles/Journaler-net Class Usage Examples

Méthodes publiques

Méthode Description
AsArray ( ) : byte[]

Access the underlying byte array

ByteRingBuffer ( int size ) : System

Create a ByteRingBuffer with a given size

WriteByte ( byte value ) : bool

Write a single byte to the buffer. If this is the last byte written to the buffer the BufferFull event will be raised

WriteBytes ( ArraySegment input ) : bool

Write an array of bytes to the buffer

WriteInt ( int value ) : bool

Write an int to the buffer. If the buffer becomes full during the write the BufferFull will be raised and then the remaining bytes will be written at the begining of the buffer.

WriteLong ( long value ) : bool

Write a long to the buffer If the buffer becomes full during the write the BufferFull will be raised and then the remaining bytes will be written at the begining of the buffer.

this ( int index ) : byte

Read the byte at the given index

Method Details

AsArray() public méthode

Access the underlying byte array
public AsArray ( ) : byte[]
Résultat byte[]

ByteRingBuffer() public méthode

Create a ByteRingBuffer with a given size
public ByteRingBuffer ( int size ) : System
size int number of bytes the buffer will contain
Résultat System

WriteByte() public méthode

Write a single byte to the buffer. If this is the last byte written to the buffer the BufferFull event will be raised
public WriteByte ( byte value ) : bool
value byte the value to write to the buffer
Résultat bool

WriteBytes() public méthode

Write an array of bytes to the buffer
public WriteBytes ( ArraySegment input ) : bool
input ArraySegment The array of byte to write from
Résultat bool

WriteInt() public méthode

Write an int to the buffer. If the buffer becomes full during the write the BufferFull will be raised and then the remaining bytes will be written at the begining of the buffer.
public WriteInt ( int value ) : bool
value int the value to write to the buffer
Résultat bool

WriteLong() public méthode

Write a long to the buffer If the buffer becomes full during the write the BufferFull will be raised and then the remaining bytes will be written at the begining of the buffer.
public WriteLong ( long value ) : bool
value long the value to write to the buffer
Résultat bool

this() public méthode

Read the byte at the given index
public this ( int index ) : byte
index int index within the buffer
Résultat byte