code: public static InputStream wrap(InputStream is, ProgressBarBuilder pbb) {
          long size = Util.getInputStreamSize(is);
          if (size != -1)
              pbb.setInitialMax(size);
          return new ProgressBarWrappedInputStream(is, pbb.build());
      }
docs: Wraps an {@link InputStream} so that when read, a progress bar is shown to track the reading progress.
  For this function the progress bar can be fully customized by using a {@link ProgressBarBuilder}.
  @param is Input stream to be wrapped
  @param pbb An instance of a {@link ProgressBarBuilder}