code: public void write(String s, int off, int len) throws IOException {
          // defect 312981 begin
          //ensureOpen();
      	if (closed) {
      	    throw new IOException("Stream closed");
          }
          // defect 312981 end
          if (bufferSize == 0) {
              initOut();
              out.write(s, off, len);
              return;
          }
          int b = off, t = off + len;
          while (b < t) {
              int d = min(bufferSize - nextChar, t - b);
              s.getChars(b, b + d, cb, nextChar);
              b += d;
              nextChar += d;
              if (nextChar >= bufferSize) 
                  if (autoFlush)
                      flushBuffer();
                  else
                      bufferOverflow();
          }
      }
docs: Write a portion of a String.
  
  @param  s     String to be written
  @param  off   Offset from which to start reading characters
  @param  len   Number of characters to be written