示例#1
0
        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);
        }
示例#2
0
		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);
		}