C# Class SocketLibrary.Packets.PacketUtil

显示文件 Open project: Wotuu/RTS_XNA_v2

Public Methods

Method Description
DecodeInt ( byte bytes ) : int

Converts a byte array with length 4 to an int.

DecodePacketInt ( Packet p, int index ) : int

Decodes a packet that should contain an int.

DecodePacketString ( Packet p, int index ) : String

Decodes a packet to a string.

Method Details

DecodeInt() public static method

Converts a byte array with length 4 to an int.
public static DecodeInt ( byte bytes ) : int
bytes byte The bytes to convert.
return int

DecodePacketInt() public static method

Decodes a packet that should contain an int.
public static DecodePacketInt ( Packet p, int index ) : int
p Packet The packet
index int The byte index to start searching for the int
return int

DecodePacketString() public static method

Decodes a packet to a string.
public static DecodePacketString ( Packet p, int index ) : String
p Packet The packet to decode.
index int
return String