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

            UnfinishedByteArray.Append(head.Bytes);
            AttachData(data);
        }
Esempio n. 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));
        }
Esempio n. 3
0
 internal VBANPacket(VBANPacketHead <T> head)
 {
     Head = head;
     UnfinishedByteArray = new UnfinishedByteArray(MaxSize, true);
 }
Esempio n. 4
0
 internal VBANPacketHead(byte[] bytes)
 {
     _unfinishedByteArray = new UnfinishedByteArray(Size);
     _unfinishedByteArray.Append(bytes);
 }