Arci.Networking
Arci.Networking.Data.Packet Class Reference

Represents byte stream as a packet More...

Inheritance diagram for Arci.Networking.Data.Packet:
Arci.Networking.Data.ByteBuffer

Public Member Functions

 Packet (UInt16 opcodeNumber)
 Creates instance of writeable packet More...
 
 Packet (Enum opcode)
 Creates instance of writeable packet More...
 
 Packet (byte[] data)
 Creates instance of readable packet More...
 
void Initialize (UInt16 opcodeNumber)
 Inicializes data in packet More...
 
void Initialize (Enum opcode)
 Inicializes data in packet More...
 
PacketBuilder Builder ()
 Starts building this packet More...
 
- Public Member Functions inherited from Arci.Networking.Data.ByteBuffer
 ByteBuffer ()
 Creates new instance of writable ByteBuffer More...
 
void WriteGuidByteStreamInOrder (PacketGuid guid, params int[] indexes)
 Writes packet guid byte stream in specified order More...
 
void WriteGuidBitStreamInOrder (PacketGuid guid, params int[] indexes)
 Writes packet guid bit stream in specified order More...
 
void Write (PacketGuid guid)
 Writes packet guid into data stream More...
 
void Write (Guid guid)
 Writes guid into data stream More...
 
void Write (Guid guid, string format)
 Writes guid into data stream More...
 
void Write (DateTime dateTime)
 Writes datetime data into stream More...
 
void WriteBit (bool bit)
 Writes bit value to stream More...
 
void FlushBits ()
 Flushes bits from memory to stream More...
 
void ClearUnflushedBits ()
 Clears unflushed bits More...
 
bool ReadBit ()
 Reads 1 bit More...
 
UInt64 ReadBits (byte bitsCount)
 Reads exact number of bits and return result as a value More...
 
void Write (string val)
 Writes string value with ASCII encoding More...
 
void Write (string val, Encoding encoding)
 Writes string value More...
 
void Write (ByteBuffer buffer)
 Appends the whole storage of bytebuffer to this one More...
 
byte [] ReadBytes ()
 Reads multiple bytes based on length written in stream More...
 
byte [] ReadBytes (int length)
 Reads multiple bytes More...
 
string ReadString ()
 Reads string with ASCII encoding More...
 
string ReadString (Encoding encoding)
 Reads string More...
 
void ReadGuidByteStreamInOrder (PacketGuid guid, params int[] indexes)
 Reads guid byte stream in specified order More...
 
void ReadGuidBitStreamInOrder (PacketGuid guid, params int[] indexes)
 Reads guid bit stream in specified order More...
 
PacketGuid ReadPacketGuid ()
 Reads packet guid from data stream More...
 
Guid ReadGuid ()
 Reads guid from data stream More...
 
Guid ReadGuid (string format)
 Reads guid from data stream More...
 
DateTime ReadDateTime ()
 Reads datetime from data stream More...
 
void Write (byte[] val)
 Writes byte[] value to stream More...
 
void Dispose ()
 Disposes object More...
 
SByte ReadSByte ()
 Reads SByte value from stream More...
 
void Write (SByte val)
 Writes SByte value to stream More...
 
Int16 ReadInt16 ()
 Reads Int16 value from stream More...
 
void Write (Int16 val)
 Writes Int16 value to stream More...
 
Int32 ReadInt32 ()
 Reads Int32 value from stream More...
 
void Write (Int32 val)
 Writes Int32 value to stream More...
 
Int64 ReadInt64 ()
 Reads Int64 value from stream More...
 
void Write (Int64 val)
 Writes Int64 value to stream More...
 
Byte ReadByte ()
 Reads Byte value from stream More...
 
void Write (Byte val)
 Writes Byte value to stream More...
 
UInt16 ReadUInt16 ()
 Reads UInt16 value from stream More...
 
void Write (UInt16 val)
 Writes UInt16 value to stream More...
 
UInt32 ReadUInt32 ()
 Reads UInt32 value from stream More...
 
void Write (UInt32 val)
 Writes UInt32 value to stream More...
 
UInt64 ReadUInt64 ()
 Reads UInt64 value from stream More...
 
void Write (UInt64 val)
 Writes UInt64 value to stream More...
 
Single ReadSingle ()
 Reads Single value from stream More...
 
void Write (Single val)
 Writes Single value to stream More...
 
Double ReadDouble ()
 Reads Double value from stream More...
 
void Write (Double val)
 Writes Double value to stream More...
 
Decimal ReadDecimal ()
 Reads Decimal value from stream More...
 
void Write (Decimal val)
 Writes Decimal value to stream More...
 
void WriteBit (SByte bit)
 Writes 1 if SByte value is different from 0, otherwise writes 0 More...
 
void WriteBits (SByte value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (Int16 bit)
 Writes 1 if Int16 value is different from 0, otherwise writes 0 More...
 
void WriteBits (Int16 value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (Int32 bit)
 Writes 1 if Int32 value is different from 0, otherwise writes 0 More...
 
void WriteBits (Int32 value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (Int64 bit)
 Writes 1 if Int64 value is different from 0, otherwise writes 0 More...
 
void WriteBits (Int64 value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (Byte bit)
 Writes 1 if Byte value is different from 0, otherwise writes 0 More...
 
void WriteBits (Byte value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (UInt16 bit)
 Writes 1 if UInt16 value is different from 0, otherwise writes 0 More...
 
void WriteBits (UInt16 value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (UInt32 bit)
 Writes 1 if UInt32 value is different from 0, otherwise writes 0 More...
 
void WriteBits (UInt32 value, byte bitsCount)
 Writes value with specified number of bits More...
 
void WriteBit (UInt64 bit)
 Writes 1 if UInt64 value is different from 0, otherwise writes 0 More...
 
void WriteBits (UInt64 value, byte bitsCount)
 Writes value with specified number of bits More...
 

Properties

UInt16 OpcodeNumber [get]
 Opcode number of this Packet More...
 

Additional Inherited Members

- Public Attributes inherited from Arci.Networking.Data.ByteBuffer
byte [] Data => memoryStream.ToArray()
 Data in packet More...
 
- Protected Member Functions inherited from Arci.Networking.Data.ByteBuffer
 ByteBuffer (byte[] data)
 Creates new instance of readable ByteBuffer More...
 
void Initialize ()
 Inicializes data in ByteBuffer More...
 

Detailed Description

Represents byte stream as a packet

Constructor & Destructor Documentation

§ Packet() [1/3]

Arci.Networking.Data.Packet.Packet ( UInt16  opcodeNumber)
inline

Creates instance of writeable packet

Parameters
opcodeNumberValue to be set as opcode number of current packet

§ Packet() [2/3]

Arci.Networking.Data.Packet.Packet ( Enum  opcode)
inline

Creates instance of writeable packet

Parameters
opcodeValue to be set as opcode number of current packet

§ Packet() [3/3]

Arci.Networking.Data.Packet.Packet ( byte []  data)
inline

Creates instance of readable packet

Parameters
dataData to form Packet from

Member Function Documentation

§ Builder()

PacketBuilder Arci.Networking.Data.Packet.Builder ( )

Starts building this packet

Returns
Packet builder

§ Initialize() [1/2]

void Arci.Networking.Data.Packet.Initialize ( UInt16  opcodeNumber)
inline

Inicializes data in packet

Parameters
opcodeNumberValue to be set as new opcode number of current packet

§ Initialize() [2/2]

void Arci.Networking.Data.Packet.Initialize ( Enum  opcode)

Inicializes data in packet

Parameters
opcodeValue to be set as new opcode number of current packet

Property Documentation

§ OpcodeNumber

UInt16 Arci.Networking.Data.Packet.OpcodeNumber
get

Opcode number of this Packet