Code example for NoSuchProviderException

0
            if (prov != null)
            { 
                return prov;
            } 
 
            throw new NoSuchProviderException("provider " + providerName + " not found.");
        } 
 
        return null;  
    } 
 
    static InputStream attachDigestsToInputStream(Collection digests, InputStream s)
    { 
        InputStream result = s;
        Iterator it = digests.iterator();
        while (it.hasNext())
        { 
            DigestCalculator digest = (DigestCalculator)it.next();
            result = new TeeInputStream(result, digest.getOutputStream());
        }