示例#1
0
        public PayloadReader(PageLoader pageLoader, UInt64 pageNumber, UInt64 payloadPosition, UInt64 payloadOffset, UInt64 payloadSize) : base(pageLoader)
        {
            this.LoadPage(pageNumber);
            this.Position = payloadPosition + payloadOffset;

            this._payloadSize        = payloadSize;
            this._payloadSizeOnPage  = this.CalculatePayloadSizeOfFirstPage(payloadSize);
            this._payloadSizeOnPage -= payloadOffset; // 0 for header, header length for body

            this._nextPage        = 0;
            this._bytesRead       = 0;
            this._bytesReadOnPage = 0;
            this._isFirstPage     = true;
        }
示例#2
0
        protected virtual void Dispose(Boolean disposing)
        {
            if (!this._isDisposed)
            {
                if (disposing)
                {
                    this._pageReader = null;
                    this._pageLoader = null;

                    if (this._stream != null)
                    {
                        this._stream.Close();
                        this._stream.Dispose();
                        this._stream = null;
                    }
                }

                this._isDisposed = true;
            }
        }
示例#3
0
        public PageReader(PageLoader pageLoader)
        {
            this._pageLoader = pageLoader;

            this._bytes = new Byte[this._pageLoader.PageSize];
        }
示例#4
0
 private void Open(Stream stream)
 {
     this._pageLoader = new PageLoader(stream, this.FileHeader);
     this._pageReader = new PageReader(this._pageLoader);
 }