Code example for InputStream

Methods: read

0
    /** 
     * @see java.io.InputStream#read() 
     */ 
    @Override 
    public int read() throws IOException { 
        int ch = in.read();
        if (ch != -1) {
            crc32.update(ch);
        } 
        return ch;
    } 
 
    /** 
     * @see java.io.InputStream#read(byte[], int, int) 
     */ 
    @Override 
    public int read(byte[] b, int off, int len) throws IOException {
        int result = in.read(b, off, len);
        if (result != -1) {
            crc32.update(b, off, result);
        }