nextPage = (SinglePage) getDataPage(next); pageLen = nextPage.ph.getDataLength(); offset = 0; pages.add(nextPage);
try { lock.acquire(Lock.READ_LOCK); nextPage = (SinglePage) getDataPage(next); pageLen = nextPage.ph.getDataLength(); offset = 0; pages.add(nextPage); } catch (LockException e) { throw new IOException("failed to acquire a read lock on " + getFile().getName()); } finally { lock.release(); }
		public final int read() throws IOException {			if (pageLen < 0)				return -1;			if (offset == pageLen) {				final long next = nextPage.getPageHeader().getNextInChain();				if (next < 1) {					pageLen = -1;					offset = 0;					return -1;				}				nextPage = (SinglePage) getDataPage(next);				pageLen = nextPage.ph.getDataLength();				offset = 0;				pages.add(nextPage);			}			return (int) (nextPage.data[offset++] & 0xFF);		}