Exemple #1
0
        public static Int32[] ReadInt32Array(this KafkaReader reader)
        {
            var size = reader.ReadInt32();

            if (size == -1)
            {
                return(null);
            }
            var array = new Int32[size];

            for (int i = 0; i < size; i++)
            {
                array[i] = reader.ReadInt32();
            }
            return(array);
        }
Exemple #2
0
        public static T[] ReadArray <T>(this KafkaReader reader, Func <T> func) where T : IKafkaReadable
        {
            var size = reader.ReadInt32();

            if (size == -1)
            {
                return(null);
            }

            var array = new T[size];

            for (int i = 0; i < size; i++)
            {
                array[i] = func();
                array[i].FetchFrom(reader);
            }
            return(array);
        }