code: public MockResponse setChunkedBody(byte[] body, int maxChunkSize) {
          removeHeader("Content-Length");
          headers.add(CHUNKED_BODY_HEADER);
  
          try {
              ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
              int pos = 0;
              while (pos < body.length) {
                  int chunkSize = Math.min(body.length - pos, maxChunkSize);
                  bytesOut.write(Integer.toHexString(chunkSize).getBytes(US_ASCII));
                  bytesOut.write("\r\n".getBytes(US_ASCII));
                  bytesOut.write(body, pos, chunkSize);
                  bytesOut.write("\r\n".getBytes(US_ASCII));
                  pos += chunkSize;
              }
              bytesOut.write("0\r\n\r\n".getBytes(US_ASCII)); // last chunk + empty trailer + crlf
  
              this.body = bytesOut.toByteArray();
              return this;
          } catch (IOException e) {
              throw new AssertionError(); // In-memory I/O doesn't throw IOExceptions.
          }
      }
docs: Sets the response body to {@code body}, chunked every {@code
  maxChunkSize} bytes.