public static OscMessage FromBytes(byte[] bytes) { var addressPattern = OscString.GetValue(ref bytes); var argumentTags = OscString.GetValue(ref bytes).Substring(1); var arguments = argumentTags.Select(t => OscValue.FromBytes(t, ref bytes)); return(new OscMessage(new OscAddressPattern(addressPattern), arguments)); }
public static OscValue FromBytes(char tag, ref byte[] bytes) { switch (tag) { case 'i': return(OscInt.FromBytes(ref bytes)); case 'f': return(OscFloat.FromBytes(ref bytes)); case 's': return(OscString.FromBytes(ref bytes)); case 'b': return(OscBlob.FromBytes(ref bytes)); default: throw new OscException($"Unable to read OSC argument with tag '{tag}'."); } }