public void write(String str,int off,int len){
  buf.append(str.substring(off,off + len));
}

public void write ( String str , int off , int len ) { buf . append ( str . substring ( off , off + len ) ) ; }
write a portion of a string .
