Exemplo n.º 1
0
        private Task WriteGroupElements(IMessageChannel channel, IReadOnlyList <BigInteger> groupElements)
        {
            MessageComposer message = new MessageComposer(2 * groupElements.Count);

            foreach (BigInteger groupElement in groupElements)
            {
                byte[] packedGroupElement = groupElement.ToByteArray();
                message.Write(packedGroupElement.Length);
                message.Write(packedGroupElement);
            }

            return(channel.WriteMessageAsync(message.Compose()));
        }
Exemplo n.º 2
0
        private Task WriteOptions(IMessageChannel channel, byte[][][] options, int numberOfOptions, int numberOfInvocations, int numberOfMessageBytes)
        {
            MessageComposer message = new MessageComposer(numberOfOptions * numberOfInvocations);

            for (int j = 0; j < numberOfInvocations; ++j)
            {
                for (int i = 0; i < numberOfOptions; ++i)
                {
                    message.Write(options[j][i]);
                }
            }

            return(channel.WriteMessageAsync(message.Compose()));
        }
Exemplo n.º 3
0
 public BufferBuilder With(byte[] buffer)
 {
     _composer.Write(buffer);
     return(this);
 }