public StringBuilder minify(InputStream inputStream) throws IOException {
  BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(inputStream));
  StringBuilder minified=new StringBuilder();
  Boolean startOfLine=true;
  while (true) {
    int cInt=bufferedReader.read();
    if (cInt == -1) {
      break;
    }
    char c=(char)cInt;
    if (c == '/') {
      int c1=bufferedReader.read();
      if (c1 == '/') {
        skipUntilEndOfSingleLineComment(bufferedReader,minified);
        startOfLine=true;
      }
 else       if (c1 == '*') {
        skipUntilEndOfMultiLineComment(bufferedReader,minified);
      }
 else {
        minified.append(c);
        if (c1 != -1) {
          minified.append((char)c1);
        }
      }
      continue;
    }
 else     if (c == '\'' || c == '"') {
      minified.append(c);
      includeUntilAfter(bufferedReader,minified,c);
      startOfLine=false;
      continue;
    }
    if (startOfLine && (c == ' ' || c == '\t')) {
      continue;
    }
    startOfLine=(c == '\n');
    minified.append(c);
  }
  bufferedReader.close();
  return minified;
}

public StringBuilder minify ( InputStream inputStream ) throws IOException { BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; StringBuilder minified = new StringBuilder ( ) ; Boolean startOfLine = true ; while ( true ) { int cInt = bufferedReader . read ( ) ; if ( cInt == - 1 ) { break ; } char c = ( char ) cInt ; if ( c == '/' ) { int c1 = bufferedReader . read ( ) ; if ( c1 == '/' ) { skipUntilEndOfSingleLineComment ( bufferedReader , minified ) ; startOfLine = true ; } else if ( c1 == '*' ) { skipUntilEndOfMultiLineComment ( bufferedReader , minified ) ; } else { minified . append ( c ) ; if ( c1 != - 1 ) { minified . append ( ( char ) c1 ) ; } } continue ; } else if ( c == '\'' || c == '"' ) { minified . append ( c ) ; includeUntilAfter ( bufferedReader , minified , c ) ; startOfLine = false ; continue ; } if ( startOfLine && ( c == ' ' || c == '\t' ) ) { continue ; } startOfLine = ( c == '\n' ) ; minified . append ( c ) ; } bufferedReader . close ( ) ; return minified ; }
this is the interface method of the class .
