Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.Buffering.ByteBufferBase Class Referenceabstract

Base byte buffer class. More...

Inheritance diagram for PushTechnology.DiffusionCore.Buffering.ByteBufferBase:
PushTechnology.DiffusionCore.Buffering.ByteBuffer PushTechnology.DiffusionCore.Buffering.MessageByteBuffer

Public Member Functions

virtual void Acquire ()
 
ByteBufferBase Clear ()
 Resets the limit to the length and sets the position to zero. More...
 
ByteBufferBase Compact ()
 Compact this buffer. More...
 
ByteBufferBase Expand (int expectedRemaining)
 Expand the buffer. More...
 
ByteBufferBase Expand (int position, int expectedRemaining)
 Expand the buffer. More...
 
ByteBufferBase Flip ()
 Sets the limit to the position, and sets the position to 0. More...
 
byte Get ()
 Gets the byte from the current position. More...
 
byte Get (int position)
 Gets the byte at a given position. More...
 
void Get (byte[] buffer)
 Gets the buffer. More...
 
void Get (byte[] buffer, int offset, int length)
 Gets the buffer. More...
 
void Get (int position, byte[] buffer, int offset, int length)
 Gets the buffer. More...
 
void Get (int position, ByteBuffer buffer, int offset, int length)
 Gets the buffer. More...
 
char GetChar ()
 Gets a character at the current position. More...
 
char GetChar (int position)
 Gets a character at a given position. More...
 
string GetHexDump ()
 Gets a hexadecimal dump of this buffer. More...
 
short GetInt16 ()
 Gets a short at the current position. More...
 
short GetInt16 (int position)
 Gets a short at a given position. More...
 
int GetInt32 ()
 Gets a uint32 at the current position. More...
 
int GetInt32 (int position)
 Gets a uint32 at a given position. More...
 
long GetInt64 ()
 Gets a uint64 at the current position. More...
 
long GetInt64 (int position)
 Gets a uint64 at a given position. More...
 
sbyte GetSByte ()
 
sbyte GetSByte (int position)
 
ushort GetUInt16 ()
 
ushort GetUInt16 (int position)
 
uint GetUInt32 ()
 
uint GetUInt32 (int position)
 
ulong GetUInt64 ()
 
ulong GetUInt64 (int position)
 
ByteBufferBase Put (params byte[] data)
 
ByteBufferBase PutRange (byte[] data)
 
ByteBufferBase PutRange (byte[] data, bool incrementPosition)
 
ByteBufferBase Put (ByteBufferBase data)
 
ByteBufferBase Put (byte value)
 
ByteBufferBase Put (char value)
 
ByteBufferBase PutUtf8 (string str)
 
ByteBufferBase Put (short value)
 
ByteBufferBase Put (int value)
 
ByteBufferBase Put (long value)
 
ByteBufferBase Put (sbyte value)
 
ByteBufferBase Put (ushort value)
 
ByteBufferBase Put (uint value)
 
ByteBufferBase Put (ulong value)
 
ByteBufferBase Put (byte[] buffer, bool incrementPosition)
 
ByteBufferBase Put (int position, ByteBufferBase data)
 
ByteBufferBase Put (int position, byte value)
 
ByteBufferBase Put (int position, char value)
 
ByteBufferBase Put (int position, short value)
 
ByteBufferBase Put (int position, int value)
 
ByteBufferBase Put (int position, long value)
 
ByteBufferBase Put (int position, sbyte value)
 
ByteBufferBase Put (int position, ushort value)
 
ByteBufferBase Put (int position, uint value)
 
ByteBufferBase Put (int position, ulong value)
 
ByteBufferBase Put (byte[] buffer, int offset, int length, bool incrementPosition=true)
 
ByteBufferBase Put (int position, byte[] buffer, int offset, int length)
 
virtual void Release ()
 
ByteBufferBase Rewind ()
 
ByteBufferBase Skip (int numBytes)
 
ByteBufferBase Slice ()
 
override string ToString ()
 

Static Public Member Functions

static void SetAllocator (IByteBufferAllocator allocator)
 

Protected Member Functions

abstract void DoCompact ()
 
abstract byte DoReadByte (int position)
 
abstract void DoReadBytes (int position, byte[] dest, int offset, int length)
 
abstract void DoResize (int newSize)
 
abstract void DoWrite (int position, byte value)
 
abstract void DoWrite (int position, byte[] src, int offset, int length)
 

Static Protected Attributes

static IByteBufferAllocator THE_ALLOCATOR = new ByteBufferAllocator()
 The byte buffer allocator. More...
 

Properties

abstract byte[] Bytes [get]
 Get the bytes in the buffer. More...
 
abstract int Length [get]
 Get the number of bytes in the buffer. More...
 
abstract int Capacity [get]
 Get the capacity of the buffer. More...
 
bool HasRemaining [get]
 Do we have any bytes remaining? More...
 
bool IsAutoExpand [get, set]
 Is this an auto-expanding buffer? More...
 
int Limit [get, set]
 Get/set the limit of the buffer. More...
 
int Position [get, set]
 Get/set the currently indexed position into the buffer. More...
 
int Remaining [get]
 Returns how many bytes are remaining in the buffer. More...
 

Detailed Description

Base byte buffer class.

Member Function Documentation

virtual void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Acquire ( )
virtual

ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Clear ( )

Resets the limit to the length and sets the position to zero.

Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Compact ( )

Compact this buffer.

Returns
abstract void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoCompact ( )
protectedpure virtual
abstract byte PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoReadByte ( int  position)
protectedpure virtual

Parameters
position
Returns

Implemented in PushTechnology.DiffusionCore.Buffering.ByteBuffer.

abstract void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoReadBytes ( int  position,
byte[]  dest,
int  offset,
int  length 
)
protectedpure virtual

Parameters
position
dest
offset
length

Implemented in PushTechnology.DiffusionCore.Buffering.ByteBuffer.

abstract void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoResize ( int  newSize)
protectedpure virtual

Parameters
newSize

Implemented in PushTechnology.DiffusionCore.Buffering.ByteBuffer.

abstract void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoWrite ( int  position,
byte  value 
)
protectedpure virtual

Parameters
position
value

Implemented in PushTechnology.DiffusionCore.Buffering.ByteBuffer.

abstract void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.DoWrite ( int  position,
byte[]  src,
int  offset,
int  length 
)
protectedpure virtual

Parameters
position
src
offset
length

Implemented in PushTechnology.DiffusionCore.Buffering.ByteBuffer.

ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Expand ( int  expectedRemaining)

Expand the buffer.

Parameters
expectedRemainingThe number of bytes to expand the buffer by.
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Expand ( int  position,
int  expectedRemaining 
)

Expand the buffer.

Parameters
positionThe start position.
expectedRemaining
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Flip ( )

Sets the limit to the position, and sets the position to 0.

Returns
byte PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( )

Gets the byte from the current position.

Returns
byte PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( int  position)

Gets the byte at a given position.

Parameters
position
Returns
void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( byte[]  buffer)

Gets the buffer.

Parameters
buffer
void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( byte[]  buffer,
int  offset,
int  length 
)

Gets the buffer.

Parameters
buffer
offset
length
void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( int  position,
byte[]  buffer,
int  offset,
int  length 
)

Gets the buffer.

Parameters
position
buffer
offset
length
void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Get ( int  position,
ByteBuffer  buffer,
int  offset,
int  length 
)

Gets the buffer.

Parameters
position
buffer
offset
length
char PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetChar ( )

Gets a character at the current position.

Returns
char PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetChar ( int  position)

Gets a character at a given position.

Parameters
position
Returns
string PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetHexDump ( )

Gets a hexadecimal dump of this buffer.

Returns
short PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt16 ( )

Gets a short at the current position.

Returns
short PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt16 ( int  position)

Gets a short at a given position.

Parameters
position
Returns
int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt32 ( )

Gets a uint32 at the current position.

Returns
int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt32 ( int  position)

Gets a uint32 at a given position.

Parameters
position
Returns
long PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt64 ( )

Gets a uint64 at the current position.

Returns
long PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetInt64 ( int  position)

Gets a uint64 at a given position.

Parameters
position
Returns
sbyte PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetSByte ( )

Returns
sbyte PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetSByte ( int  position)

Parameters
position
Returns
ushort PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt16 ( )

Returns
ushort PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt16 ( int  position)

Parameters
position
Returns
uint PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt32 ( )

Returns
uint PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt32 ( int  position)

Parameters
position
Returns
ulong PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt64 ( )

Returns
ulong PushTechnology.DiffusionCore.Buffering.ByteBufferBase.GetUInt64 ( int  position)

Parameters
position
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( params byte[]  data)

Parameters
data
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( ByteBufferBase  data)

Parameters
data
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( byte  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( char  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( short  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( long  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( sbyte  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( ushort  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( uint  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( ulong  value)

Parameters
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( byte[]  buffer,
bool  incrementPosition 
)

Parameters
buffer
incrementPosition
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
ByteBufferBase  data 
)

Parameters
position
data
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
byte  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
char  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
short  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
int  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
long  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
sbyte  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
ushort  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
uint  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
ulong  value 
)

Parameters
position
value
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( byte[]  buffer,
int  offset,
int  length,
bool  incrementPosition = true 
)

Parameters
buffer
offset
length
incrementPosition
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Put ( int  position,
byte[]  buffer,
int  offset,
int  length 
)

Parameters
position
buffer
offset
length
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.PutRange ( byte[]  data)

Parameters
data
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.PutRange ( byte[]  data,
bool  incrementPosition 
)

Parameters
data
incrementPosition
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.PutUtf8 ( string  str)

Parameters
str
Returns
virtual void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Release ( )
virtual

ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Rewind ( )

Returns
static void PushTechnology.DiffusionCore.Buffering.ByteBufferBase.SetAllocator ( IByteBufferAllocator  allocator)
static

Parameters
allocator
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Skip ( int  numBytes)

Parameters
numBytes
Returns
ByteBufferBase PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Slice ( )

Returns
override string PushTechnology.DiffusionCore.Buffering.ByteBufferBase.ToString ( )

Returns

Member Data Documentation

IByteBufferAllocator PushTechnology.DiffusionCore.Buffering.ByteBufferBase.THE_ALLOCATOR = new ByteBufferAllocator()
staticprotected

The byte buffer allocator.

Property Documentation

abstract byte [] PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Bytes
get

Get the bytes in the buffer.

abstract int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Capacity
get

Get the capacity of the buffer.

bool PushTechnology.DiffusionCore.Buffering.ByteBufferBase.HasRemaining
get

Do we have any bytes remaining?

bool PushTechnology.DiffusionCore.Buffering.ByteBufferBase.IsAutoExpand
getset

Is this an auto-expanding buffer?

abstract int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Length
get

Get the number of bytes in the buffer.

int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Limit
getset

Get/set the limit of the buffer.

int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Position
getset

Get/set the currently indexed position into the buffer.

int PushTechnology.DiffusionCore.Buffering.ByteBufferBase.Remaining
get

Returns how many bytes are remaining in the buffer.