code: @Override
      public void write(String str, int offset, int count) throws IOException {
          synchronized (lock) {
              if (count < 0) {
                  throw new StringIndexOutOfBoundsException(str, offset, count);
              }
              if (str == null) {
                  throw new NullPointerException("str == null");
              }
              if ((offset | count) < 0 || offset > str.length() - count) {
                  throw new StringIndexOutOfBoundsException(str, offset, count);
              }
              checkStatus();
              CharBuffer chars = CharBuffer.wrap(str, offset, count + offset);
              convert(chars);
          }
      }
docs: Writes {@code count} characters starting at {@code offset} in {@code str}
  to this writer. The characters are immediately converted to bytes by the
  character converter and stored in a local buffer. If the buffer gets full
  as a result of the conversion, this writer is flushed.
  
  @param str
  the string containing characters to write.
  @param offset
  the start position in {@code str} for retrieving characters.
  @param count
  the maximum number of characters to write.
  @throws IOException
  if this writer has already been closed or another I/O error
  occurs.
  @throws IndexOutOfBoundsException
  if {@code offset < 0} or {@code count < 0}, or if
  {@code offset + count} is bigger than the length of
  {@code str}.