public static OSCPacket Unpack(byte[] bytes, ref int start, int end) { if (bytes[start] == '#') { return(OSCBundle.Unpack(bytes, ref start, end)); } else { return(OSCMessage.Unpack(bytes, ref start)); } }
public static new OSCBundle Unpack(byte[] bytes, ref int start, int end) { string address = UnpackString(bytes, ref start); if (!address.Equals(BUNDLE)) return null; long timestamp = UnpackLong(bytes, ref start); OSCBundle bundle = new OSCBundle(timestamp); while (start < end) { int length = UnpackInt(bytes, ref start); bundle.Append(OSCPacket.Unpack(bytes, ref start, start + length)); } return bundle; }
public static new OSCBundle Unpack(byte[] bytes, ref int start, int end) { string address = UnpackString(bytes, ref start); if (!address.Equals(BUNDLE)) { return(null); } long timestamp = UnpackLong(bytes, ref start); OSCBundle bundle = new OSCBundle(timestamp); while (start < end) { int length = UnpackInt(bytes, ref start); bundle.Append(OSCPacket.Unpack(bytes, ref start, start + length)); } return(bundle); }