public byte[] ToArray() { MemoryStream stream = new MemoryStream(Length); BinaryWriter buffer = new BigEndianBinaryWriter(stream); buffer.Write(PREAMBLE_LENGTH); buffer.Write(POSTAMBLE_LENGTH); buffer.Write(PACKET_IDENTIFIER); Int16 flagsAndRootLength = (Int16)(SACNPacket.FLAGS | Length); buffer.Write(flagsAndRootLength); buffer.Write(ROOT_VECTOR); buffer.Write(UUID.ToByteArray()); buffer.Write(FramingLayer.ToArray()); return(stream.ToArray()); }
public byte[] ToArray() { MemoryStream stream = new MemoryStream(Length); BinaryWriter buffer = new BigEndianBinaryWriter(stream); Int16 flagsAndDMPLength = (Int16)(SACNPacket.FLAGS | Length); buffer.Write(flagsAndDMPLength); buffer.Write(DMP_VECTOR); buffer.Write(ADDRESS_TYPE_AND_DATA_TYPE); buffer.Write(FIRST_PROPERTY_ADDRESS); buffer.Write(ADDRESS_INCREMENT); buffer.Write((Int16)(Data.Length + 1)); buffer.Write(ZERO_ADDRESS); buffer.Write(Data); return(stream.ToArray()); }
public byte[] ToArray() { MemoryStream stream = new MemoryStream(Length); BinaryWriter buffer = new BigEndianBinaryWriter(stream); Int16 flagsAndFramingLength = (Int16)(SACNPacket.FLAGS | Length); buffer.Write(flagsAndFramingLength); buffer.Write(FRAMING_VECTOR); buffer.Write(Encoding.UTF8.GetBytes(SourceName)); for (int i = 0; i < 64 - SourceName.Length; i++) { buffer.Write((byte)0); } buffer.Write(PRIORITY); buffer.Write(RESERVED); buffer.Write(SequenceID); buffer.Write(OPTIONS); buffer.Write(UniverseID); buffer.Write(DMPLayer.ToArray()); return(stream.ToArray()); }