public int ReadPageData(FileStreamWrapper stream, int pageIdx) { if (null == stream) { throw new ArgumentNullException(); } byte[] dataBuffer = new byte[PageSize]; // read from the file stream if (0 > pageIdx || stream.Length < (pageIdx + 1) * PageSize) { throw new InvalidPageException(); } stream.Seek(pageIdx * PageSize, SeekOrigin.Begin); stream.Read(dataBuffer, 0, dataBuffer.Length); // initialize members this.recordList = new List <byte[]>(); this.ReadPageData(dataBuffer); return(pageIdx); }
public int ReadPageData(FileStreamWrapper stream, int pageIdx) { if (null == stream) { throw new ArgumentNullException(); } byte[] dataBuffer = new byte[PageSize]; // read from the file stream if (0 > pageIdx || stream.Length < (pageIdx + 1) * PageSize) { throw new InvalidPageException(); } stream.Seek(pageIdx * PageSize, SeekOrigin.Begin); stream.Read(dataBuffer, 0, dataBuffer.Length); // initialize members this.recordList = new List<byte[]>(); this.ReadPageData(dataBuffer); return pageIdx; }