public static new OSCBundle Unpack(byte[] bytes, ref int start, int end, bool extendedMode = false) { string address = unpackString(bytes, ref start); //Console.WriteLine("bundle: " + address); if (!address.Equals(BUNDLE)) { return(null); // TODO } DateTime timestamp = unpackTimeTag(bytes, ref start); OSCBundle bundle = new OSCBundle(timestamp, extendedMode); while (start < end) { int length = unpackInt(bytes, ref start); int sub_end = start + length; bundle.Append(OSCPacket.Unpack(bytes, ref start, sub_end, extendedMode)); } return(bundle); }
public static new OSCBundle Unpack(byte[] bytes, ref int start, int end) { string address = unpackString(bytes, ref start); //Console.WriteLine("bundle: " + address); if (!address.Equals(BUNDLE)) { return(null); // TODO } long timestamp = unpackLong(bytes, ref start); OSCBundle bundle = new OSCBundle(timestamp); while (start < end) { int length = unpackInt(bytes, ref start); int sub_end = start + length; //Console.WriteLine(bytes.Length +" "+ start+" "+length+" "+sub_end); bundle.Append(OSCPacket.Unpack(bytes, ref start, sub_end)); } return(bundle); }