public void write(String s,int off,int len){
  if (text != null) {
    text.append(s.substring(off,off + len));
    if ((col+=len) > wrap)     println();
  }
 else {
    super.write(s,off,len);
    flush();
  }
}

public void write ( String s , int off , int len ) { if ( text != null ) { text . append ( s . substring ( off , off + len ) ) ; if ( ( col += len ) > wrap ) println ( ) ; } else { super . write ( s , off , len ) ; flush ( ) ; } }
write a portion of a string .
