using IFramework.Packets;
namespace IFramework.Net
{
internal class NetProtocolProvider : INetProtocolProvider
{
public static NetProtocolProvider CreateProvider()
{
return new NetProtocolProvider();
}
public NetProtocolProvider()
{ }
///
/// 解码
///
///
///
///
///
public Packet Decode(byte[] buffer, int offset, int size)
{
return Packet.UnPackPacket(buffer, offset, size);
}
///
/// 编码
///
///
///
public byte[] Encode(Packet pkg)
{
return pkg.Pack();
}
}
}