} else {
} else if (keywordLength > 0) {
    private static void copy(InputStream src, OutputStream dst, byte[] eol, Map keywords) throws IOException {        if (keywords != null && keywords.isEmpty()) {            keywords = null;        }        PushbackInputStream in = new PushbackInputStream(src, 2048);        byte[] keywordBuffer = new byte[256];                while(true) {            int r = in.read();            if (r < 0) {                return;            }            if ((r == '\r' || r == '\n') && eol != null) {                int next = in.read();                dst.write(eol);                if (r == '\r' && next == '\n') {                    continue;                }                if (next < 0) {                    return;                }                in.unread(next);            } else if (r == '$' && keywords != null) {                // advance in buffer for 256 more chars.                dst.write(r);                int length = in.read(keywordBuffer);                int keywordLength = 0;                for(int i = 0; i < length; i++) {                    if (keywordBuffer[i] == '\r' || keywordBuffer[i] == '\n') {                        // failure, save all before i, unread remains.                        dst.write(keywordBuffer, 0, i);                        in.unread(keywordBuffer, i, length - i);                        keywordLength = -1;                        break;                    } else if (keywordBuffer[i] == '$') {                        keywordLength = i + 1;                        break;                    }                }                if (keywordLength < 0) {                    continue;                } else if (keywordLength == 0) {                    if (length > 0) {                        dst.write(keywordBuffer, 0, length);                    }                } else {                    int from = translateKeyword(dst, keywords, keywordBuffer, keywordLength);                    in.unread(keywordBuffer, from, length - from);                }            } else {                dst.write(r);            }        }            }