01: /*
02: * @(#)HashVerifier.java 0.3-2 18/06/1999
03: *
04: * This file is part of the HTTPClient package
05: * Copyright (C) 1996-1999 Ronald Tschalär
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free
19: * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20: * MA 02111-1307, USA
21: *
22: * For questions, suggestions, bug-reports, enhancement-requests etc.
23: * I may be contacted at:
24: *
25: * ronald@innovation.ch
26: *
27: */
28:
29: package HTTPClient;
30:
31: /**
32: * This interface defines a hash verifier.
33: *
34: * @version 0.3-2 18/06/1999
35: * @author Ronald Tschalär
36: */
37:
38: interface HashVerifier {
39: /**
40: * This method is invoked when a digest of a stream has been calculated.
41: * It must verify that the hash (or some function of it) is correct and
42: * throw an IOException if it is not.
43: *
44: * @param hash the calculated hash
45: * @param len the number of bytes read from the stream
46: * @exception IOException if the verification fails.
47: */
48: public void verifyHash(byte[] hash, long len)
49: throws java.io.IOException;
50: }
|