Beispiel #1
0
        public VBANPacket(VBANPacketHead <T> head, byte[] data)
        {
            Head = head;
            UnfinishedByteArray = new UnfinishedByteArray(MaxSize);

            UnfinishedByteArray.Append(head.Bytes);
            AttachData(data);
        }
Beispiel #2
0
        public VBANPacketHead(
            int protocol,
            int sampleRateIndex,
            int samples,
            int channel,
            int format,
            int codec,
            string streamName,
            int frameCounter
            )
        {
            Util.CheckRange(samples, 0, 255);
            Util.CheckRange(channel, 0, 255);

            _unfinishedByteArray = new UnfinishedByteArray(Size, true);

            _unfinishedByteArray.Append(Encoding.ASCII.GetBytes("VBAN"));
            _unfinishedByteArray.Append((byte)(protocol | sampleRateIndex));
            _unfinishedByteArray.Append((byte)samples, (byte)channel);
            _unfinishedByteArray.Append((byte)(format | codec));
            _unfinishedByteArray.Append(Util.TrimArray(Encoding.ASCII.GetBytes(streamName), 16));
            _unfinishedByteArray.Append(BitConverter.GetBytes(frameCounter));
        }
Beispiel #3
0
 internal VBANPacketHead(byte[] bytes)
 {
     _unfinishedByteArray = new UnfinishedByteArray(Size);
     _unfinishedByteArray.Append(bytes);
 }