throw e;
boolean failOnPrimary = (openMask & OPEN_FAIL_ON_PRIMARY) != 0; if (failOnPrimary && generation == GENERATIONS_INFINITE) generation = generations[0];  File textFile = null; InputStream textIS = null; for (int idx = 0; idx < generations.length; idx++) { if (generation != 0) { if (generations[idx] > generation || (failOnPrimary && generations[idx] != generation)) continue; } File file; if (generations[idx] != 0) file = new File(parent, name + '.' + generations[idx]); else file = referenceFile; InputStream is = null; CacheInfo info; synchronized (cacheFiles) { info = (CacheInfo) cacheFiles.get(file); } long timeStamp = file.lastModified(); if (info == null || timeStamp != info.timeStamp) { try { is = new FileInputStream(file); if (is.available() < maxInputStreamBuffer) is = new BufferedInputStream(is); Checksum cksum = getChecksumCalculator(); int filetype = getStreamType(is, cksum); info = new CacheInfo(filetype, cksum, timeStamp); synchronized (cacheFiles) { cacheFiles.put(file, info); } } catch (IOException e) { } }    if (failOnPrimary) { if (info != null && info.filetype == FILETYPE_VALID) { inputFile = file; if (is != null) return is; return new FileInputStream(file); } throw new IOException("ReliableFile is corrupt"); }   if (info == null) continue;   switch (info.filetype) { case FILETYPE_VALID : inputFile = file; if (is != null) return is; return new FileInputStream(file);  case FILETYPE_NOSIGNATURE : if (textFile == null) { textFile = file; textIS = is; } break; }
	synchronized InputStream getInputStream() throws IOException {		try {			lock();		} catch (IOException e) {			/* the lock request failed; decrement the use count */			release();			throw e;		}		try {			BufferedInputStream bis = recoverFile();			if (bis == null)				return new FileInputStream(orgFile.getPath());			else				return bis; // don't double read file from storage		} catch (IOException e) {			unlock();			release();			throw e;		}	}