private long processCSS(String contextPath, String cssFilePath, InputStream inputStream, OutputStream outputStream) throws IOException {
        ServletContext context = this.getServletContext();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, DEFAULT_CHARSET));
        String line;
        long bytesWritten = 0;
        StringBuffer buffer = new StringBuffer();
        while ((line = bufferedReader.readLine()) != null) {
            buffer.setLength(0);
            buffer.append(line);
            line = this.processCSSLine(context, contextPath, cssFilePath, buffer);
            byte[] bytes = (line + "\n").getBytes(DEFAULT_CHARSET);
            outputStream.write(bytes);
            bytesWritten += bytes.length;
        }
        return bytesWritten;
    }
private long processCSS ( String contextPath , String cssFilePath , InputStream inputStream , OutputStream outputStream ) throws IOException { ServletContext context = this . getServletContext ( ) ; BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream , DEFAULT_CHARSET ) ) ; String line ; long bytesWritten = 0 ; StringBuffer buffer = new StringBuffer ( ) ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { buffer . setLength ( 0 ) ; buffer . append ( line ) ; line = this . processCSSLine ( context , contextPath , cssFilePath , buffer ) ; byte [ ] bytes = ( line + "\n" ) . getBytes ( DEFAULT_CHARSET ) ; outputStream . write ( bytes ) ; bytesWritten += bytes . length ; } return bytesWritten ; }
@param cssFilePath  - css file path
@param contextPath  - context path or custom configured context path
@param inputStream  - input stream
@param outputStream - output stream
@throws IOException - thrown in case anything (IO read/write) goes wrong