SteamKit2.TcpPacket.GetData C# (CSharp) Method

GetData() public method

Gets the full packet data with a big-endian length prepended onto the payload.
public GetData ( ) : byte[]
return byte[]
        public byte[] GetData()
        {
            BinaryWriterEx bb = new BinaryWriterEx( true );

            byte[] payload = this.GetPayload();

            bb.Write( ( uint )payload.Length );
            bb.Write( payload );

            return bb.ToArray();
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Sends the specified packet on the socket.
 /// </summary>
 /// <param name="packet">The packet.</param>
 public void Send(TcpPacket packet)
 {
     this.Send(packet.GetData());
 }
All Usage Examples Of SteamKit2.TcpPacket::GetData