public static OscPacket Read( OscReader reader, int count, Uri origin = null, OscTimeTag?timeTag = null) { if (reader.PeekByte() == (byte)'#') { return(OscBundle.Read(reader, count, origin)); } return(OscMessage.Read(reader, count, origin, timeTag)); }
/// <summary> /// Read the osc packet from a byte array /// </summary> /// <param name="bytes">array to read from</param> /// <param name="index">the offset within the array where reading should begin</param> /// <param name="count">the number of bytes in the packet</param> /// <param name="origin">the origin that is the origin of this packet</param> /// <param name="timeTag">the time tag asociated with the parent</param> /// <returns>the packet</returns> public static OscPacket Read( byte[] bytes, int index, int count, Uri origin = null, OscTimeTag?timeTag = null) { //if (OscBundle.IsBundle(bytes, index, count) == true) if (bytes[index] == (byte)'#') { return(OscBundle.Read(bytes, index, count, origin)); } return(OscMessage.Read(bytes, index, count, origin, timeTag)); }