Example #1
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));
     }
 }
Example #2
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
            }
            DateTime  timestamp = unpackTimeTag(bytes, ref start);
            OSCBundle bundle    = new OSCBundle(timestamp);

            while (start < end)
            {
                int length  = unpackInt(bytes, ref start);
                int sub_end = start + length;
                bundle.Append(OSCPacket.Unpack(bytes, ref start, sub_end));
            }

            return(bundle);
        }