public override ByteString GetBlocksBuffer() { BlockListAsLongs.Builder builder = Builder(); foreach (Replica replica in this) { builder.Add(replica); } return(builder.Build().GetBlocksBuffer()); }
/// <summary> /// Prepare an instance to encode the collection of replicas into an /// efficient ByteString. /// </summary> /// <param name="replicas">- replicas to encode</param> /// <returns>BlockListAsLongs</returns> public static BlockListAsLongs Encode <_T0>(ICollection <_T0> replicas) where _T0 : Replica { BlockListAsLongs.Builder builder = Builder(); foreach (Replica replica in replicas) { builder.Add(replica); } return(builder.Build()); }