Class BufferedChecksumStreamInput

java.lang.Object
java.io.InputStream
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public final class BufferedChecksumStreamInput
extends FilterStreamInput
Similar to Lucene's BufferedChecksumIndexInput, however this wraps a StreamInput so anything read will update the checksum
  • Constructor Details

    • BufferedChecksumStreamInput

      public BufferedChecksumStreamInput​(StreamInput in, java.lang.String source, BufferedChecksumStreamInput reuse)
    • BufferedChecksumStreamInput

      public BufferedChecksumStreamInput​(StreamInput in, java.lang.String source)
  • Method Details

    • getChecksum

      public long getChecksum()
    • readByte

      public byte readByte() throws java.io.IOException
      Description copied from class: StreamInput
      Reads and returns a single byte.
      Overrides:
      readByte in class FilterStreamInput
      Throws:
      java.io.IOException
    • readBytes

      public void readBytes​(byte[] b, int offset, int len) throws java.io.IOException
      Description copied from class: StreamInput
      Reads a specified number of bytes into an array at the specified offset.
      Overrides:
      readBytes in class FilterStreamInput
      Parameters:
      b - the array to read bytes into
      offset - the offset in the array to start storing bytes
      len - the number of bytes to read
      Throws:
      java.io.IOException
    • readShort

      public short readShort() throws java.io.IOException
      Overrides:
      readShort in class FilterStreamInput
      Throws:
      java.io.IOException
    • readInt

      public int readInt() throws java.io.IOException
      Description copied from class: StreamInput
      Reads four bytes and returns an int.
      Overrides:
      readInt in class FilterStreamInput
      Throws:
      java.io.IOException
    • readLong

      public long readLong() throws java.io.IOException
      Description copied from class: StreamInput
      Reads eight bytes and returns a long.
      Overrides:
      readLong in class FilterStreamInput
      Throws:
      java.io.IOException
    • reset

      public void reset() throws java.io.IOException
      Overrides:
      reset in class FilterStreamInput
      Throws:
      java.io.IOException
    • read

      public int read() throws java.io.IOException
      Overrides:
      read in class FilterStreamInput
      Throws:
      java.io.IOException
    • markSupported

      public boolean markSupported()
      Overrides:
      markSupported in class java.io.InputStream
    • skip

      public long skip​(long numBytes) throws java.io.IOException
      Overrides:
      skip in class java.io.InputStream
      Throws:
      java.io.IOException
    • mark

      public void mark​(int readlimit)
      Overrides:
      mark in class java.io.InputStream
    • resetDigest

      public void resetDigest()
    • getSource

      public java.lang.String getSource()