line = token.matcher(line).replaceAll(entry.getValue().toString());
String replacement = entry.getValue().toString();     Matcher matcher = token.matcher(buffer); int start = 0; while (matcher.find(start)) { buffer.replace(matcher.start(), matcher.end(), replacement); start = matcher.end(); }
	void writeLine(Writer out, String line) throws IOException {		if (line.length() > 0) {			// not very efficient - may need to rewrite			Iterator it = tokens.entrySet().iterator();			while (it.hasNext()) {				Map.Entry entry = (Map.Entry) it.next();				Pattern token = (Pattern) entry.getKey();				line = token.matcher(line).replaceAll(entry.getValue().toString());			}			out.write(line);		}		out.write(lineEnd);	}