docs: public byte[] getResponseBody(int maxlen) throws IOException {
          if (maxlen < 0) throw new IllegalArgumentException("maxlen must be positive");
          if (this.responseBody == null) {
              InputStream instream = getResponseBodyAsStream();
              if (instream != null) {
                  // we might already know that the content is larger
                  long contentLength = getResponseContentLength();
                  if ((contentLength != -1) && (contentLength > maxlen)) {
                      throw new HttpContentTooLargeException(
                              "Content-Length is " + contentLength, maxlen);
                  }
                  
                  LOG.debug("Buffering response body");
                  ByteArrayOutputStream rawdata = new ByteArrayOutputStream(
                          contentLength > 0 ? (int) contentLength : DEFAULT_INITIAL_BUFFER_SIZE);
                  byte[] buffer = new byte[2048];
                  int pos = 0;
                  int len;
                  do {
                      len = instream.read(buffer, 0, Math.min(buffer.length, maxlen-pos));
                      if (len == -1) break;
                      rawdata.write(buffer, 0, len);
                      pos += len;
                  } while (pos < maxlen);
                  
                  setResponseStream(null);
                  // check if there is even more data
                  if (pos == maxlen) {
                      if (instream.read() != -1)
                          throw new HttpContentTooLargeException(
                                  "Content-Length not known but larger than "
                                  + maxlen, maxlen);
                  }
                  this.responseBody = rawdata.toByteArray();
              }
          }
          return this.responseBody;
      }