code: private void writeToImpl(Writer out, String encoding, byte[] bufferToWrite, int bufferToWriteLen)
              throws IOException {
          String writeStr;
          if (encoding != null) {
              writeStr = new String(bufferToWrite, 0, bufferToWriteLen, encoding);
          } else {
              writeStr = new String(bufferToWrite, 0, bufferToWriteLen);
          }
          out.write(writeStr);
      }
docs: Write <code>bufferToWriteLen</code> of bytes from <code>bufferToWrite</code> to
  <code>out</code> encoding it at the same time.
  
  @param out
  @param encoding
  @param bufferToWrite
  @param bufferToWriteLen
  @throws IOException