/// <summary> /// Creates the specified root layer. /// </summary> /// <param name="rootLayer">The root layer.</param> /// <param name="reader">The reader.</param> /// <returns></returns> public AcnPacket Create(AcnRootLayer rootLayer, AcnBinaryReader reader) { AcnPacket packet = (AcnPacket)Activator.CreateInstance(typeof(TPacketType)); packet.Root = rootLayer; packet.ReadData(reader); return(packet); }
public static AcnPacket ReadPacket(AcnRootLayer header, AcnBinaryReader data) { AcnPacket packet = AcnPacket.Create(header); if (packet != null) { packet.Root = header; packet.ReadData(data); } return(packet); }