Code example for DigestInputStream

0
        assertReadsFailWithNullPointerException(new DataInputStream(null));
    } 
 
    public void testDigestInputStream() throws IOException, NoSuchAlgorithmException { 
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        assertReadsFailWithNullPointerException(new DigestInputStream(null, md5));
    } 
 
    public void testFilterInputStream() throws IOException { 
        assertReadsFailWithNullPointerException(new FilterInputStream(null) {});
    } 
 
    public void testInflaterInputStream() throws IOException { 
        try { 
            new InflaterInputStream(null);
            fail();
        } catch (NullPointerException expected) {
        } 
        try { 
            new InflaterInputStream(null, new Inflater());