code: public static byte[] getHash( Algorithm algorithm,
                                    InputStream stream ) throws NoSuchAlgorithmException, IOException {
          CheckArg.isNotNull(algorithm, "algorithm");
          return getHash(algorithm.digestName(), stream);
      }
docs: Get the hash of the supplied content, using the supplied digest algorithm.
  
  @param algorithm the hashing function algorithm that should be used
  @param stream the stream containing the content to be hashed; may not be null
  @return the hash of the contents as a byte array
  @throws NoSuchAlgorithmException if the supplied algorithm could not be found
  @throws IllegalArgumentException if the algorithm is null
  @throws IOException if there is an error reading the stream