Beispiel #1
0
        /// <summary>
        /// Creates a list of <see cref="FB.Block"/>
        /// </summary>
        public static List <FB.Block> GetRecordBatches(this FB.Footer root)
        {
            int length = root.RecordBatchesLength;
            var result = new List <FB.Block>(length);

            for (int i = 0; i < length; i++)
            {
                FB.Block element = root.RecordBatches(i).GetValueOrDefault();
                result.Add(element);
            }

            return(result);
        }
        private void ReadFooter(byte[] data)
        {
            FB.Footer root = FB.Footer.GetRootAsFooter(new ByteBuffer(data));

            //read schema
            Schema = new Schema(root.Schema.GetValueOrDefault());

            //read list of blocks for convenience
            for (int i = 0; i < root.RecordBatchesLength; i++)
            {
                FB.Block block = root.RecordBatches(i).GetValueOrDefault();

                _blocks.Add(block);
            }
        }