source
Created by: Andrew
This commit is contained in:
25
trunk/Common/IO/Packet/PacketBase.cs
Normal file
25
trunk/Common/IO/Packet/PacketBase.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace KartExtreme.IO.Packet
|
||||
{
|
||||
public abstract class PacketBase
|
||||
{
|
||||
public abstract int Length { get; }
|
||||
public abstract int Position { get; }
|
||||
|
||||
public abstract byte[] ToArray();
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (byte b in this.ToArray())
|
||||
{
|
||||
sb.AppendFormat("{0:X2} ", b);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user