Ejemplo n.º 1
0
 public static Broker FromStream(ReadByteStream stream)
 {
     return new Broker
         {
             BrokerId = stream.ReadInt(),
             Host = stream.ReadInt16String(),
             Port = stream.ReadInt()
         };
 }
Ejemplo n.º 2
0
        public static Topic FromStream(ReadByteStream stream)
        {
            var topic = new Topic
                {
                    ErrorCode = stream.ReadInt16(),
                    Name = stream.ReadInt16String(),
                    Partitions = new List<Partition>()
                };

            var numPartitions = stream.ReadInt();
            for (int i = 0; i < numPartitions; i++)
            {
                topic.Partitions.Add(Partition.FromStream(stream));
            }

            return topic;
        }