示例#1
0
        void Persist(string key, byte[] buffer, long commit)
        {
            var frame = StorageFramesEvil.EncodeFrame(key, buffer, commit);

            if (!_currentWriter.Fits(frame.Data.Length + frame.Hash.Length))
            {
                CloseWriter();
                EnsureWriterExists(_all.Length);
            }

            _currentWriter.Write(frame.Data);
            _currentWriter.Write(frame.Hash);
            _currentWriter.Flush();
        }
示例#2
0
        private void Persist(string key, byte[] buffer, long commit)
        {
            var frame = StorageFramesEvil.EncodeFrame(key, buffer, commit);

            if (!this._currentWriter.Fits(frame.Data.Length + frame.Hash.Length))
            {
                this.CloseWriter();
                this.EnsureWriterExists(this._cache.StoreVersion);
            }

            this._currentWriter.Write(frame.Data);
            this._currentWriter.Write(frame.Hash);
            this._currentWriter.Flush();
        }