public TeraPacket(byte[] data) { try { Stream = new MemoryStream(data); Reader = new BinaryReader(Stream); ID = (PacketHeaderEnum)Reader.ReadByte(); } catch (Exception e) { Console.WriteLine("[Error] Can't read OverPacket : " + e.ToString()); } }
public TeraPacket(PacketHeaderEnum id) { try { ID = id; Stream = new MemoryStream(); Writer = new BinaryWriter(Stream); Writer.Write((byte)id); } catch (Exception e) { Console.WriteLine("[Error] Can't write OverPacket : " + e.ToString()); } }