Documentation of 'org.apache.commons.compress.utils.ChecksumCalculatingInputStream' Java class
ChecksumCalculatingInputStream
org.apache.commons.compress.utils

Class ChecksumCalculatingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    public class ChecksumCalculatingInputStream
    extends java.io.InputStream
    A stream that calculates the checksum of the data read.
    Since:
    1.14
    • Constructor Summary

      Constructors 
      Constructor and Description
      ChecksumCalculatingInputStream(java.util.zip.Checksum checksum, java.io.InputStream inputStream) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      long getValue()
      Returns the calculated checksum.
      int read()
      Reads a single byte from the stream
      int read(byte[] b)
      Reads a byte array from the stream
      int read(byte[] b, int off, int len)
      Reads from the stream into a byte array.
      long skip(long n) 
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, reset
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChecksumCalculatingInputStream

        public ChecksumCalculatingInputStream(java.util.zip.Checksum checksum,
                                              java.io.InputStream inputStream)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Reads a single byte from the stream
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException - if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
      • read

        public int read(byte[] b)
                 throws java.io.IOException
        Reads a byte array from the stream
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException - if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
      • read

        public int read(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Reads from the stream into a byte array.
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException - if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
      • skip

        public long skip(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • getValue

        public long getValue()
        Returns the calculated checksum.
        Returns:
        the calculated checksum.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.