예제 #1
0
        private void WriteBlock()
        {
            if (_blockCount > 0)
            {
                byte[] dataToWrite = _tempBuffer.ToArray();

                _writer.WriteDataBlock(_codec.Compress(dataToWrite), _header.SyncData, _blockCount);

                // reset block buffer
                _blockCount = 0;
                _tempBuffer = new MemoryStream();
            }
        }
예제 #2
0
        private void WriteBlock()
        {
            if (_blockCount > 0)
            {
                byte[] dataToWrite = _blockStream.ToArray();

                // write count
                _encoder.WriteLong(_blockCount);

                // write data
                _encoder.WriteBytes(_codec.Compress(dataToWrite));

                // write sync marker
                _encoder.WriteFixed(_syncData);

                // reset / re-init block
                _blockCount   = 0;
                _blockStream  = new MemoryStream();
                _blockEncoder = new Writer(_blockStream);
            }
        }