ReadTopic() public method

Reads fixed-length topic from underlying stream using given encoding.
public ReadTopic ( string encoding ) : string
encoding string /// The encoding to use. ///
return string
Ejemplo n.º 1
0
        public static string ParseFrom(KafkaBinaryReader reader, int count, bool skipReqInfo = false)
        {
            Guard.Assert<ArgumentNullException>(() => reader != null);
            var sb = new StringBuilder();

            if (!skipReqInfo)
            {
                sb.Append("Request size: ");
                sb.Append(reader.ReadInt32());
                sb.Append(", RequestId: ");
                short reqId = reader.ReadInt16();
                sb.Append(reqId);
                sb.Append("(");
                sb.Append((RequestTypes)reqId);
                sb.Append(")");
            }

            sb.Append(", Topic: ");
            string topic = reader.ReadTopic(DefaultEncoding);
            sb.Append(topic);
            sb.Append(", Partition: ");
            sb.Append(reader.ReadInt32());
            sb.Append(", Set size: ");
            sb.Append(reader.ReadInt32());
            int size = count - DefaultHeaderSize - GetTopicLength(topic);
            sb.Append(", Set {");
            sb.Append(BufferedMessageSet.ParseFrom(reader, size));
            sb.Append("}");
            return sb.ToString();
        }