InputStream in = null;  try { in = new BufferedInputStream(new FileInputStream(fullFileName)); ByteArrayOutputStream out = new ByteArrayOutputStream();  sourceFile = new SourceFile(); sourceFile.addLineOffset(0); LineNumberMapBuilder mapBuilder = new LineNumberMapBuilder(sourceFile);   byte[] buf = new byte[1024]; int n; while ((n = in.read(buf)) >= 0) { mapBuilder.addData(buf, n); out.write(buf, 0, n); } mapBuilder.eof();  sourceFile.setData(out.toByteArray()); } catch (FileNotFoundException e) {   } finally { if (in != null) in.close(); }  if (sourceFile != null) {
File file = new File(fullFileName); if (file.exists()) {  sourceFile = new SourceFile(fullFileName);
	public SourceFile findSourceFile(String packageName, String fileName) throws IOException {		// Create a fully qualified source filename using the package name.		StringBuffer fullName = new StringBuffer();		if (!packageName.equals("")) {			fullName.append(packageName.replace('.', File.separatorChar));			fullName.append(File.separatorChar);		}		fullName.append(fileName);		fileName = fullName.toString();		// Is the file in the cache already?		SourceFile sourceFile = cache.get(fileName);		if (sourceFile == null) {			 // Find this source file, add its data to the cache			 if (DEBUG) System.out.println("Trying "  + fileName + "...");			// Query each element of the source path to find the requested source file			Iterator<String> i = sourceBaseList.iterator();					while (i.hasNext()) {				String sourceBase = i.next();				// Try to read the file from current source base element				String fullFileName = sourceBase + File.separator + fileName;				if (DEBUG) System.out.println("Trying " + fullFileName + "...");				InputStream in = null;				try {					in = new BufferedInputStream(new FileInputStream(fullFileName));					ByteArrayOutputStream out = new ByteArrayOutputStream();					sourceFile = new SourceFile();					sourceFile.addLineOffset(0); // Line 0 starts at offset 0					LineNumberMapBuilder mapBuilder = new LineNumberMapBuilder(sourceFile);					// Copy all of the data from the file into the byte array output stream					byte[] buf = new byte[1024];					int n;					while ((n = in.read(buf)) >= 0) {						mapBuilder.addData(buf, n);						out.write(buf, 0, n);					}					mapBuilder.eof();					sourceFile.setData(out.toByteArray());				} catch (FileNotFoundException e) {					// We're probably looking in the wrong directory -					// just ignore the failure and continue with the loop				} finally {					if (in != null)						in.close();				}				if (sourceFile != null) {					// Success!					// Put the data for the file in the cache					cache.put(fileName, sourceFile);					break;				}			}			// Couldn't find the source file.			if (sourceFile == null)				throw new FileNotFoundException("Can't find source file " + fileName);		}		return sourceFile;	}