C# Класс SocketLibrary.Packets.Packet

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Packet System

Открытые методы

Метод Описание
AddData ( byte data ) : void

Adds a byte of data to the list.

AddInt ( int value ) : void

Adds an int to this packet.

AddString ( String s ) : void

Adds a string to this packet

GetData ( ) : byte[]

Gets the data in this packet, excluding the header.

GetFullData ( ) : byte[]

Converts the data in this packet to a byte array, this includes the header.

GetHeader ( ) : byte

Gets the header of this packet.

GetPacketID ( ) : int

Gets the packetID of this packet.

Packet ( byte header ) : System
Packet ( byte header, byte data ) : System
SetHeader ( byte header ) : void

Sets the header of this byte. Also see ProtocolHeader.cs

SetPacketID ( byte bytes ) : void

Sets the packet ID. Must be a length of 4!.

SetPacketID ( int packetID ) : void

Sets the packet ID.

Приватные методы

Метод Описание
Packet ( ) : System

Описание методов

AddData() публичный Метод

Adds a byte of data to the list.
public AddData ( byte data ) : void
data byte The byte to add
Результат void

AddInt() публичный Метод

Adds an int to this packet.
public AddInt ( int value ) : void
value int The int to add
Результат void

AddString() публичный Метод

Adds a string to this packet
public AddString ( String s ) : void
s String The string
Результат void

GetData() публичный Метод

Gets the data in this packet, excluding the header.
public GetData ( ) : byte[]
Результат byte[]

GetFullData() публичный Метод

Converts the data in this packet to a byte array, this includes the header.
public GetFullData ( ) : byte[]
Результат byte[]

GetHeader() публичный Метод

Gets the header of this packet.
public GetHeader ( ) : byte
Результат byte

GetPacketID() публичный Метод

Gets the packetID of this packet.
public GetPacketID ( ) : int
Результат int

Packet() публичный Метод

public Packet ( byte header ) : System
header byte
Результат System

Packet() публичный Метод

public Packet ( byte header, byte data ) : System
header byte
data byte
Результат System

SetHeader() публичный Метод

Sets the header of this byte. Also see ProtocolHeader.cs
public SetHeader ( byte header ) : void
header byte The header to give this packet
Результат void

SetPacketID() публичный Метод

Sets the packet ID. Must be a length of 4!.
public SetPacketID ( byte bytes ) : void
bytes byte The bytes.
Результат void

SetPacketID() публичный Метод

Sets the packet ID.
public SetPacketID ( int packetID ) : void
packetID int The packet id.
Результат void