public byte[] GetBytes()
    {
        var output = new byte[DATA_SIZE + MessageHeader.HEADER_SIZE];

        header.GetBytes().CopyTo(output, 0);
        data.CopyTo(output, MessageHeader.HEADER_SIZE);

        return(output);
    }
Beispiel #2
0
    public byte[] GetBytes()
    {
        var output = new byte[Size];

        header.GetBytes().CopyTo(output, 0);
        poseDescription.GetBytes().CopyTo(output, MessageHeader.HEADER_SIZE);

        return(output);
    }
Beispiel #3
0
    public byte[] GetBytes()
    {
        int bufferSize = AudioManager.SamplesPerChunk * sizeof(float);

        byte[] output = new byte[MessageHeader.HEADER_SIZE + bufferSize];
        header.GetBytes().CopyTo(output, 0);

        Buffer.BlockCopy(data, 0, output, MessageHeader.HEADER_SIZE, bufferSize);
        return(output);
    }
    public byte[] GetBytes()
    {
        var output = new byte[MessageHeader.HEADER_SIZE + (PoseDescription.DATA_SIZE * poseDescriptions.Count)];

        header.GetBytes().CopyTo(output, 0);

        for (int idx = 0; idx < poseDescriptions.Count; idx++)
        {
            poseDescriptions[idx].GetBytes()
            .CopyTo(output, MessageHeader.HEADER_SIZE + (idx * PoseDescription.DATA_SIZE));
        }

        return(output);
    }
 public void ReadDataFromNetworkStream(NetworkStream networkStream, MessageHeader _header)
 {
     header = new MessageHeader(_header.GetBytes());
     networkStream.Read(data, 0, AudioSliceSize);
 }
Beispiel #6
0
 public void ReadDataFromNetworkStream(NetworkStream networkStream, MessageHeader _header)
 {
     header = new MessageHeader(_header.GetBytes());
     networkStream.Read(data, 0, DATA_SIZE);
 }