Class ChecksumVerifyingInputStream

    • Constructor Detail

      • ChecksumVerifyingInputStream

        public ChecksumVerifyingInputStream​(Checksum checksum,
                                            InputStream in,
                                            long size,
                                            long expectedChecksum)
    • Method Detail

      • read

        public int read()
                 throws IOException
        Reads a single byte from the stream
        Specified by:
        read in class InputStream
        Throws:
        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 IOException
        Reads a byte array from the stream
        Overrides:
        read in class InputStream
        Throws:
        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 IOException
        Reads from the stream into a byte array.
        Overrides:
        read in class InputStream
        Throws:
        IOException - if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
      • getBytesRemaining

        public long getBytesRemaining()
        Returns:
        bytes remaining to read
        Since:
        1.21