Beispiel #1
0
        //  PACK METHODS
        public static byte[] PackInternal(OSCPacket packet, ref int index)
        {
            if (_bufferIndex >= _buffers.Count)
            {
                _bufferIndex = 0;

                throw new Exception("[OSCConverter.PackInternal] You have reached the nesting package depth limit. Maximum depth of nested packages: " + _buffers.Count + "\n" +
                                    "To change the depth use: OSCConverter.SetBuffersDepth() method.");
            }

            var buffer = _buffers[_bufferIndex];

            _bufferIndex++;

            if (packet.IsBundle())
            {
                PackBundle((OSCBundle)packet, buffer, ref index);
            }
            else
            {
                PackMessage((OSCMessage)packet, buffer, ref index);
            }

            _bufferIndex--;

            return(buffer);
        }
 public static bool IsBundle(OSCPacket packet)
 {
     return(packet.IsBundle());
 }
 public static byte[] Pack(OSCPacket packet)
 {
     return(packet.IsBundle() ? PackBundle((OSCBundle)packet) : PackMessage((OSCMessage)packet));
 }