Esempio n. 1
0
        /// <summary>
        /// Output the query result into a TsvWriter instance
        /// </summary>
        public void PrintToTsvWriter(TsvWriter output)
        {
            output.WriteLine(table.ColumnNames);
            var values = new string[table.ColumnNames.Length];

            foreach (var item in cursor)
            {
                table.GetStringValues(item, values);
                output.WriteLine(values);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Converts the records to TSV representation and
        /// compresses the results.
        /// </summary>
        internal void SerializeCompress()
        {
            using var ms = new MemoryStream();

            using (var gzip = new GZipStream(ms, CompressionMode.Compress))
                using (var tsv = new TsvWriter(gzip)) {
                    tsv.WriteLine(Header);
                    var values = new string[Header.Length];

                    foreach (T record in this.data.Values)
                    {
                        table.GetStringValues(record, values);
                        tsv.WriteLine(values);
                    }
                }
            rawCompressedData = ms.ToArray();
        }