/// <summary>
        /// Disposes the writer and writes the file footer.
        /// </summary>
        public void Dispose()
        {
            if (!_dataWritten)
            {
                return;
            }

            //finalize file
            long size = _footer.Write(ThriftStream);

            //metadata size
            Writer.Write((int)size); //4 bytes

            //end magic
            WriteMagic();           //4 bytes

            Writer.Flush();
            Stream.Flush();
        }
Beispiel #2
0
        /// <summary>
        /// Disposes the writer and writes the file footer.
        /// </summary>
        public void Dispose()
        {
            if (_dataWritten)
            {
                //update row count (on append add row count to existing metadata)
                _footer.Add(_openedWriters.Sum(w => w.RowCount ?? 0));
            }

            //finalize file
            long size = _footer.Write(ThriftStream);

            //metadata size
            Writer.Write((int)size); //4 bytes

            //end magic
            WriteMagic();           //4 bytes

            Writer.Flush();
            Stream.Flush();
        }
Beispiel #3
0
        /// <summary>
        /// Disposes the writer and writes the file footer.
        /// </summary>
#pragma warning disable CA1063 // Implement IDisposable Correctly
        public void Dispose()
#pragma warning restore CA1063 // Implement IDisposable Correctly
        {
            if (_dataWritten)
            {
                //update row count (on append add row count to existing metadata)
                _footer.Add(_openedWriters.Sum(w => w.RowCount ?? 0));
            }

            //finalize file
            long size = _footer.Write(ThriftStream);

            //metadata size
            Writer.Write((int)size); //4 bytes

            //end magic
            WriteMagic();           //4 bytes

            Writer.Flush();
            Stream.Flush();
        }