This class merges BinaryWriter and BinaryReader into one.
More...
|
| bool | Recycle () |
| | Release the buffer into the reusable pool. More...
|
| |
| void | MarkAsUsed () |
| | Mark the buffer as being in use. More...
|
| |
| void | Clear () |
| | Clear the buffer. More...
|
| |
| void | CopyTo (Buffer target) |
| | Copy the contents of this buffer into the target one, trimming away unused space. More...
|
| |
| BinaryWriter | BeginWriting (bool append=false) |
| | Begin the writing process. More...
|
| |
| BinaryWriter | BeginWriting (int startOffset) |
| | Begin the writing process, appending from the specified offset. More...
|
| |
| int | EndWriting () |
| | Finish the writing process, returning the packet's size. More...
|
| |
| BinaryReader | BeginReading () |
| | Begin the reading process. More...
|
| |
| BinaryReader | BeginReading (int startOffset) |
| | Begin the reading process. More...
|
| |
| int | PeekByte (int pos) |
| | Peek at the first byte at the specified offset. More...
|
| |
| int | PeekInt (int pos) |
| | Peek at the first integer at the specified offset. More...
|
| |
| byte[] | PeekBytes (int pos, int length) |
| | Peek-read the specified number of bytes. More...
|
| |
| BinaryWriter | BeginPacket (byte packetID) |
| | Begin writing a packet: the first 4 bytes indicate the size of the data that will follow. More...
|
| |
| BinaryWriter | BeginPacket (Packet packet) |
| | Begin writing a packet: the first 4 bytes indicate the size of the data that will follow. More...
|
| |
| BinaryWriter | BeginPacket (Packet packet, int startOffset) |
| | Begin writing a packet: the first 4 bytes indicate the size of the data that will follow. More...
|
| |
| int | EndPacket () |
| | Finish writing of the packet, updating (and returning) its size. More...
|
| |
| int | EndTcpPacketStartingAt (int startOffset) |
| | Finish writing of the packet, updating (and returning) its size. More...
|
| |
| int | EndTcpPacketWithOffset (int offset) |
| | Finish writing the packet and reposition the stream's position to the specified offset. More...
|
| |
|
| int | size [get] |
| | The size of the data present in the buffer. More...
|
| |
| int | position [get, set] |
| | Position within the stream. More...
|
| |
| MemoryStream | stream [get] |
| | Underlying memory stream. More...
|
| |
| byte[] | buffer [get] |
| | Get the entire buffer (note that it may be bigger than 'size'). More...
|
| |
| static int | recycleQueue [get] |
| | Number of buffers in the recycled list. More...
|
| |
This class merges BinaryWriter and BinaryReader into one.
| BinaryWriter TNet.Buffer.BeginPacket |
( |
byte |
packetID | ) |
|
Begin writing a packet: the first 4 bytes indicate the size of the data that will follow.
| BinaryWriter TNet.Buffer.BeginPacket |
( |
Packet |
packet | ) |
|
Begin writing a packet: the first 4 bytes indicate the size of the data that will follow.
| BinaryWriter TNet.Buffer.BeginPacket |
( |
Packet |
packet, |
|
|
int |
startOffset |
|
) |
| |
Begin writing a packet: the first 4 bytes indicate the size of the data that will follow.
| BinaryReader TNet.Buffer.BeginReading |
( |
| ) |
|
Begin the reading process.
| BinaryReader TNet.Buffer.BeginReading |
( |
int |
startOffset | ) |
|
Begin the reading process.
| BinaryWriter TNet.Buffer.BeginWriting |
( |
bool |
append = false | ) |
|
Begin the writing process.
| BinaryWriter TNet.Buffer.BeginWriting |
( |
int |
startOffset | ) |
|
Begin the writing process, appending from the specified offset.
| void TNet.Buffer.Clear |
( |
| ) |
|
| void TNet.Buffer.CopyTo |
( |
Buffer |
target | ) |
|
Copy the contents of this buffer into the target one, trimming away unused space.
| static Buffer TNet.Buffer.Create |
( |
| ) |
|
|
static |
Create a new buffer, reusing an old one if possible.
| int TNet.Buffer.EndPacket |
( |
| ) |
|
Finish writing of the packet, updating (and returning) its size.
| int TNet.Buffer.EndTcpPacketStartingAt |
( |
int |
startOffset | ) |
|
Finish writing of the packet, updating (and returning) its size.
| int TNet.Buffer.EndTcpPacketWithOffset |
( |
int |
offset | ) |
|
Finish writing the packet and reposition the stream's position to the specified offset.
| int TNet.Buffer.EndWriting |
( |
| ) |
|
Finish the writing process, returning the packet's size.
| void TNet.Buffer.MarkAsUsed |
( |
| ) |
|
Mark the buffer as being in use.
| int TNet.Buffer.PeekByte |
( |
int |
pos | ) |
|
Peek at the first byte at the specified offset.
| byte [] TNet.Buffer.PeekBytes |
( |
int |
pos, |
|
|
int |
length |
|
) |
| |
Peek-read the specified number of bytes.
| int TNet.Buffer.PeekInt |
( |
int |
pos | ) |
|
Peek at the first integer at the specified offset.
| bool TNet.Buffer.Recycle |
( |
| ) |
|
Release the buffer into the reusable pool.
| static void TNet.Buffer.Recycle |
( |
Queue< Buffer > |
list | ) |
|
|
static |
Recycle an entire queue of buffers.
| static void TNet.Buffer.Recycle |
( |
Queue< Datagram > |
list | ) |
|
|
static |
Recycle an entire queue of buffers.
| static void TNet.Buffer.Recycle |
( |
List< Buffer > |
list | ) |
|
|
static |
Recycle an entire list of buffers.
| static void TNet.Buffer.Recycle |
( |
List< Datagram > |
list | ) |
|
|
static |
Recycle an entire list of buffers.
| static void TNet.Buffer.ReleaseUnusedMemory |
( |
| ) |
|
|
static |
Release all currently unused memory sitting in the memory pool.
| byte [] TNet.Buffer.buffer |
|
get |
Get the entire buffer (note that it may be bigger than 'size').
Position within the stream.
| int TNet.Buffer.recycleQueue |
|
staticget |
Number of buffers in the recycled list.
The size of the data present in the buffer.
| MemoryStream TNet.Buffer.stream |
|
get |
Underlying memory stream.
The documentation for this class was generated from the following file: