class CclOutputStreamProxy extends OutputStreamProxy {

    @Override
    public void write(final int b) throws IOException {
        final char bChar = (char) b;
        builder.append(bChar);

        if (bChar == '\n') {
            final String string = builder.toString();
            if (string.contains(outputEnd))
                doForward = false;
            else if (string.contains(outputBegin))
                doForward = true;
            else if (doForward) {
                final OutputStream proxied = getProxied();
                for (final char currentChar : string.toCharArray())
                    proxied.write(currentChar);
            }

            builder.delete(0, builder.length());
        }
    }

    public  CclOutputStreamProxy(final OutputStream out, final String outputBegin, final String outputEnd);

}