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())); }
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())); }
public BufferBuilder With(byte[] buffer) { _composer.Write(buffer); return(this); }