IT. Expert System.

Android Reference

CheckedInputStream


java.util.zip

Class CheckedInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable


    public class CheckedInputStream
    extends FilterInputStream
    The CheckedInputStream class is used to maintain a checksum at the same time as the data, on which the checksum is computed, is read from a stream. The purpose of this checksum is to establish data integrity, comparing the computed checksum against a published checksum value.
    • Constructor Detail

      • CheckedInputStream

        public CheckedInputStream(InputStream is,
                          Checksum csum)
        Constructs a new CheckedInputStream on InputStream is. The checksum will be calculated using the algorithm implemented by csum.

        Warning: passing a null source creates an invalid CheckedInputStream. All operations on such a stream will fail.

        Parameters:
        is - the input stream to calculate checksum from.
        csum - an entity implementing the checksum algorithm.
    • Method Detail

      • read

        public int read()
                 throws IOException
        Reads one byte of data from the underlying input stream and updates the checksum with the byte data.
        Overrides:
        read in class FilterInputStream
        Returns:
        -1 at the end of the stream, a single byte value otherwise.
        Throws:
        IOException - if an IOException occurs.
      • read

        public int read(byte[] buf,
               int off,
               int nbytes)
                 throws IOException
        Reads up to n bytes of data from the underlying input stream, storing it into buf, starting at offset off. The checksum is updated with the bytes read.
        Overrides:
        read in class FilterInputStream
        Parameters:
        buf - the byte array in which to store the bytes read.
        off - the initial position in buf to store the bytes read from this stream.
        nbytes - the maximum number of bytes to store in buf.
        Returns:
        the number of bytes actually read or -1 if arrived at the end of the filtered stream while reading the data.
        Throws:
        IOException - if this stream is closed or some I/O error occurs.
      • getChecksum

        public Checksum getChecksum()
        Returns the checksum calculated on the stream read so far.
        Returns:
        the updated checksum.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 203 / . Delta: 0.02902 с