code: public final DataHasher addData(InputStream inStream, int bufferSize) {
          Util.notNull(inStream, "Input stream");
          try {
              byte[] buffer = new byte[bufferSize];
              while (true) {
                  int bytesRead = inStream.read(buffer);
  
                  if (bytesRead == -1) {
                      return this;
                  }
                  addData(buffer, 0, bytesRead);
              }
          } catch (IOException e) {
              throw new HashException("Exception occurred when reading input stream while calculating hash", e);
          }
      }
docs: Adds data to the digest using the specified input stream of bytes, starting at an offset of 0.
  
  @param inStream   input stream of bytes.
  @param bufferSize maximum allowed buffer size for reading data.
  
  @return The same {@link DataHasher} object for chaining calls.
  
  @throws HashException        when hash calculation fails.
  @throws NullPointerException when input stream is null.