public static AcnPacket ReadPacket(AcnRootLayer header, AcnBinaryReader data) { AcnPacket packet = AcnPacket.Create(header); if (packet != null) { packet.Root = header; packet.ReadData(data); } return(packet); }
/// <summary> /// Reads a single packet from the data stream and returns the created packet information. This version assumes the header /// information has already been read and so starts at the PDU layer. /// </summary> /// <remarks> /// This will create the correct packet class from the registerd packet formats in the packet factory. /// </remarks> /// <param name="data">The recieved packet data.</param> /// <returns>The packet information, cast to the desired packet type.</returns> public static AcnPacket ReadPacket(AcnRootLayer header, AcnBinaryReader data) { return(AcnPacket.Create(header, data)); }