public void write(String str,int off,int len) throws IOException {
synchronized (lock) {
    char cbuf[];
    if (len <= WRITE_BUFFER_SIZE) {
      if (writeBuffer == null) {
        writeBuffer=new char[WRITE_BUFFER_SIZE];
      }
      cbuf=writeBuffer;
    }
 else {
      cbuf=new char[len];
    }
    str.getChars(off,(off + len),cbuf,0);
    write(cbuf,0,len);
  }
}

public void write ( String str , int off , int len ) throws IOException { synchronized ( lock ) { char cbuf [ ] ; if ( len <= WRITE_BUFFER_SIZE ) { if ( writeBuffer == null ) { writeBuffer = new char [ WRITE_BUFFER_SIZE ] ; } cbuf = writeBuffer ; } else { cbuf = new char [ len ] ; } str . getChars ( off , ( off + len ) , cbuf , 0 ) ; write ( cbuf , 0 , len ) ; } }
writes a portion of a string .
