docs: private static byte[] preload(InputStream stream) throws IOException {
          byte[] buf = new byte[4096];
          ByteArrayOutputStream preloaded = new ByteArrayOutputStream();
  
          int read;
          while((read = stream.read(buf)) != -1) {
              preloaded.write(buf, 0, read);
          }
  
          return preloaded.toByteArray();
      }