public void write(char c[],int off,int len){
  if ((off < 0) || (off > c.length) || (len < 0)|| ((off + len) > c.length)|| ((off + len) < 0)) {
    throw new IndexOutOfBoundsException();
  }
 else   if (len == 0) {
    return;
  }
synchronized (lock) {
    int newcount=count + len;
    if (newcount > buf.length) {
      buf=Arrays.copyOf(buf,Math.max(buf.length << 1,newcount));
    }
    System.arraycopy(c,off,buf,count,len);
    count=newcount;
  }
}

public void write ( char c [ ] , int off , int len ) { if ( ( off < 0 ) || ( off > c . length ) || ( len < 0 ) || ( ( off + len ) > c . length ) || ( ( off + len ) < 0 ) ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return ; } synchronized ( lock ) { int newcount = count + len ; if ( newcount > buf . length ) { buf = Arrays . copyOf ( buf , Math . max ( buf . length << 1 , newcount ) ) ; } System . arraycopy ( c , off , buf , count , len ) ; count = newcount ; } }
writes characters to the buffer .
