Class ByteBuffer
The byte buffer helper class.
Inheritance
System.Object
ByteBuffer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: FixAntenna.Common.dll
Syntax
public sealed class ByteBuffer
Constructors
ByteBuffer()
Creates the ByteBuffer
with allocated byte buffer.
The default buffer length if 1024 bytes.
Declaration
ByteBuffer(Int32)
Creates the ByteBuffer
with allocated byte buffer.
Declaration
public ByteBuffer(int length)
Parameters
Type |
Name |
Description |
System.Int32 |
length |
allocated buffer length
|
ByteBuffer(Int32, Boolean)
Declaration
public ByteBuffer(int length, bool useNioBuffer)
Parameters
Type |
Name |
Description |
System.Int32 |
length |
|
System.Boolean |
useNioBuffer |
|
ByteBuffer(Int32, Int32)
Declaration
public ByteBuffer(int length, int growIncrement)
Parameters
Type |
Name |
Description |
System.Int32 |
length |
|
System.Int32 |
growIncrement |
|
ByteBuffer(Int32, Int32, Boolean)
Declaration
public ByteBuffer(int size, int growIncrement, bool useNioBuffer)
Parameters
Type |
Name |
Description |
System.Int32 |
size |
buffer size in bytes
|
System.Int32 |
growIncrement |
grow size in bytes
|
System.Boolean |
useNioBuffer |
|
Fields
NoGrowthIncrement
Declaration
public const int NoGrowthIncrement = -1
Field Value
Type |
Description |
System.Int32 |
|
Methods
Add(ByteBuffer)
Declaration
public ByteBuffer Add(ByteBuffer buffer)
Parameters
Returns
Add(Byte)
Declaration
public ByteBuffer Add(byte b)
Parameters
Type |
Name |
Description |
System.Byte |
b |
a byte
|
Returns
Add(Byte[])
Appends the array argument to internal buffer.
Declaration
public ByteBuffer Add(byte[] array)
Parameters
Type |
Name |
Description |
System.Byte[] |
array |
|
Returns
Type |
Description |
ByteBuffer |
a reference to this object.
|
Add(Byte[], Int32, Int32)
Appends the array argument to internal buffer.
Declaration
public ByteBuffer Add(byte[] array, int start, int len)
Parameters
Type |
Name |
Description |
System.Byte[] |
array |
|
System.Int32 |
start |
|
System.Int32 |
len |
|
Returns
Type |
Description |
ByteBuffer |
a reference to this object.
|
Add(Char)
Declaration
public ByteBuffer Add(char b)
Parameters
Type |
Name |
Description |
System.Char |
b |
a char
|
Returns
Add(MemoryStream)
Declaration
public ByteBuffer Add(MemoryStream buffer)
Parameters
Type |
Name |
Description |
System.IO.MemoryStream |
buffer |
|
Returns
Add(String)
Declaration
public ByteBuffer Add(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Returns
AddLikeString(Int64, Int32)
Declaration
public ByteBuffer AddLikeString(long value, int minLen = 1)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
System.Int32 |
minLen |
|
Returns
Capacity()
Declaration
Returns
Type |
Description |
System.Int32 |
|
CheckAndExtend(Int64)
Declaration
public void CheckAndExtend(long length)
Parameters
Type |
Name |
Description |
System.Int64 |
length |
|
Clear()
Declaration
public ByteBuffer Clear()
Returns
Demand(Int32)
Declaration
public static ByteBuffer Demand(int size)
Parameters
Type |
Name |
Description |
System.Int32 |
size |
|
Returns
Flip()
Declaration
Returns
Get()
Declaration
Returns
Type |
Description |
System.Byte |
|
Get(Byte[])
Declaration
public ByteBuffer Get(byte[] dst)
Parameters
Type |
Name |
Description |
System.Byte[] |
dst |
|
Returns
Get(Byte[], Int32, Int32)
Declaration
public ByteBuffer Get(byte[] dst, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
dst |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Get(Int64)
Declaration
public byte Get(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Byte |
|
GetBuffer()
Declaration
public MemoryStream GetBuffer()
Returns
Type |
Description |
System.IO.MemoryStream |
|
GetBulk()
Declaration
Returns
Type |
Description |
System.Byte[] |
|
GetByteArray()
Gets internal byte buffer (buffer itself, NOT a copy)
Declaration
public byte[] GetByteArray()
Returns
Type |
Description |
System.Byte[] |
|
GetByteArray(Int32, Int32)
Gets internal byte buffer.
Declaration
public byte[] GetByteArray(int position, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
position |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Byte[] |
|
GetChar()
Declaration
Returns
Type |
Description |
System.Char |
|
GetChar(Int64)
Declaration
public char GetChar(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Char |
|
GetDouble()
Declaration
public double GetDouble()
Returns
Type |
Description |
System.Double |
|
GetDouble(Int64)
Declaration
public double GetDouble(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Double |
|
GetInt()
Declaration
Returns
Type |
Description |
System.Int32 |
|
GetInt(Int64)
Declaration
public int GetInt(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Int32 |
|
GetIntBe()
Declaration
Returns
Type |
Description |
System.Int32 |
|
GetLength()
Declaration
Returns
Type |
Description |
System.Int32 |
int length
|
GetLong()
Declaration
Returns
Type |
Description |
System.Int64 |
|
GetLong(Int64)
Declaration
public long GetLong(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Int64 |
|
GetLongBe()
Declaration
Returns
Type |
Description |
System.Int64 |
|
GetLongBe(Int64)
Declaration
public long GetLongBe(long index)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
Returns
Type |
Description |
System.Int64 |
|
GetNioBuffer()
Declaration
public MemoryStream GetNioBuffer()
Returns
Type |
Description |
System.IO.MemoryStream |
|
GetOffset()
Declaration
Returns
Type |
Description |
System.Int32 |
|
GetSubArray(Int32, Int32)
Declaration
public byte[] GetSubArray(in int start, in int length)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Byte[] |
|
IncreaseBuffer(Int64)
Declaration
public void IncreaseBuffer(long increase)
Parameters
Type |
Name |
Description |
System.Int64 |
increase |
the number of bytes
|
IsAvailable(Int32)
Checks if buffer has a numOfBytes.
Declaration
public bool IsAvailable(int length)
Parameters
Type |
Name |
Description |
System.Int32 |
length |
the requested space
|
Returns
Type |
Description |
System.Boolean |
boolean true if has
|
IsEmpty()
Declaration
Returns
Type |
Description |
System.Boolean |
|
Limit()
Declaration
Returns
Type |
Description |
System.Int32 |
|
Limit(Int64)
Declaration
public ByteBuffer Limit(long limit)
Parameters
Type |
Name |
Description |
System.Int64 |
limit |
|
Returns
Position()
Declaration
Returns
Type |
Description |
System.Int32 |
|
Position(Int32)
Declaration
public ByteBuffer Position(int position)
Parameters
Type |
Name |
Description |
System.Int32 |
position |
|
Returns
Put(Byte)
Declaration
public ByteBuffer Put(byte b)
Parameters
Type |
Name |
Description |
System.Byte |
b |
|
Returns
Put(Byte[])
Declaration
public ByteBuffer Put(byte[] src)
Parameters
Type |
Name |
Description |
System.Byte[] |
src |
|
Returns
Put(Byte[], Int32, Int32)
Declaration
public ByteBuffer Put(byte[] src, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
src |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Put(Int64, Byte)
Declaration
public ByteBuffer Put(long index, byte b)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Byte |
b |
|
Returns
Put(String)
Declaration
public ByteBuffer Put(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Returns
PutChar(Char)
Declaration
public ByteBuffer PutChar(char value)
Parameters
Type |
Name |
Description |
System.Char |
value |
|
Returns
PutChar(Int64, Char)
Declaration
public ByteBuffer PutChar(long index, char value)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Char |
value |
|
Returns
PutDouble(Double)
Declaration
public ByteBuffer PutDouble(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
PutDouble(Int64, Double)
Declaration
public ByteBuffer PutDouble(long index, double value)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Double |
value |
|
Returns
PutInAll(Int64, Int64, Byte)
Declaration
public ByteBuffer PutInAll(long start, long end, byte value)
Parameters
Type |
Name |
Description |
System.Int64 |
start |
|
System.Int64 |
end |
|
System.Byte |
value |
|
Returns
PutInt(Int32)
Declaration
public ByteBuffer PutInt(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
PutInt(Int64, Int32)
Declaration
public ByteBuffer PutInt(long index, int value)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Int32 |
value |
|
Returns
PutIntBe(Int32)
Declaration
public ByteBuffer PutIntBe(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
PutLong(Int64)
Declaration
public ByteBuffer PutLong(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Returns
PutLong(Int64, Int64)
Declaration
public ByteBuffer PutLong(long index, long value)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Int64 |
value |
|
Returns
PutLongBe(Int64)
Declaration
public ByteBuffer PutLongBe(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Returns
PutLongBe(Int64, Int64)
Declaration
public ByteBuffer PutLongBe(long index, long value)
Parameters
Type |
Name |
Description |
System.Int64 |
index |
|
System.Int64 |
value |
|
Returns
Release()
Declaration
Release(ByteBuffer)
Declaration
public static void Release(ByteBuffer buffer)
Parameters
Remaining()
Declaration
Returns
Type |
Description |
System.Int32 |
|
ResetBuffer()
Declaration
public void ResetBuffer()
SetOffset(Int32)
Declaration
public void SetOffset(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
the new offset
|
ToArray()
Declaration
Returns
Type |
Description |
System.Byte[] |
|
WrapBuffer(Byte[])
Declaration
public static ByteBuffer WrapBuffer(byte[] buffer)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
Returns