/// <summary> /// Gathers pages until finding a page for the stream indicated /// </summary> internal void GatherNextPage(int streamSerial, PageReaderLock pageLock) { // pageLock is just so we know the caller took a lock... we don't actually need it for anything else if (pageLock == null) { throw new ArgumentNullException("pageLock"); } if (!pageLock.Validate(_pageLock)) { throw new ArgumentException("pageLock"); } if (!_eosFlags.ContainsKey(streamSerial)) { throw new ArgumentOutOfRangeException("streamSerial"); } int nextSerial; do { if (_eosFlags[streamSerial]) { throw new EndOfStreamException(); } nextSerial = GatherNextPage(); if (nextSerial == -1) { throw new InvalidDataException("Could not find next page."); } } while (nextSerial != streamSerial); }
/// <summary> /// Gathers pages until finding a page for the stream indicated /// </summary> internal void GatherNextPage(int streamSerial, PageReaderLock pageLock) { // pageLock is just so we know the caller took a lock... we don't actually need it for anything else if (pageLock == null) throw new ArgumentNullException("pageLock"); if (!pageLock.Validate(_pageLock)) throw new ArgumentException("pageLock"); if (!_eosFlags.ContainsKey(streamSerial)) throw new ArgumentOutOfRangeException("streamSerial"); int nextSerial; do { if (_eosFlags[streamSerial]) throw new EndOfStreamException(); nextSerial = GatherNextPage(); if ( nextSerial == -1 ) throw new ArgumentException ( "Could not find next page." ); } while (nextSerial != streamSerial); }