code: public String getOutputBufferAsString() throws IOException
    {
      byte[] buffer = getOutputBuffer();
      if (buffer != null)
        return new String(buffer, this.getCharacterEncoding());
      else
        return null;
    }
docs: Get the output from the response outputstream as a String.
  This method should only be used to retrieve content that is known
  to be text based.  Using this method to retrieve binary data will
  corrupt the response data.