private boolean start(String type){
  long timePassed=System.currentTimeMillis() - start;
  if (timePassed > MAX_TIME) {
    close();
  }
  if (!type.equals(mode)) {
    close();
  }
  if (mode == null) {
    mode=type;
    start=System.currentTimeMillis();
    length=0;
    return true;
  }
  return false;
}

private boolean start ( String type ) { long timePassed = System . currentTimeMillis ( ) - start ; if ( timePassed > MAX_TIME ) { close ( ) ; } if ( ! type . equals ( mode ) ) { close ( ) ; } if ( mode == null ) { mode = type ; start = System . currentTimeMillis ( ) ; length = 0 ; return true ; } return false ; }
enters compact mode , closes it first if necessary .
