Package org.elasticsearch.index.translog
Class BufferedChecksumStreamInput
java.lang.Object
java.io.InputStream
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
org.elasticsearch.index.translog.BufferedChecksumStreamInput
- 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-
Field Summary
-
Constructor Summary
Constructors Constructor Description BufferedChecksumStreamInput(StreamInput in, java.lang.String source)BufferedChecksumStreamInput(StreamInput in, java.lang.String source, BufferedChecksumStreamInput reuse) -
Method Summary
Modifier and Type Method Description longgetChecksum()java.lang.StringgetSource()voidmark(int readlimit)booleanmarkSupported()intread()bytereadByte()Reads and returns a single byte.voidreadBytes(byte[] b, int offset, int len)Reads a specified number of bytes into an array at the specified offset.voidreset()voidresetDigest()longskip(long numBytes)Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, setVersionMethods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readInstant, readInt, readIntArray, readList, readLong, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalWriteable, readOptionalZoneId, readSecureString, readSet, readShort, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, readZoneId, wrap, wrap
-
Constructor Details
-
BufferedChecksumStreamInput
public BufferedChecksumStreamInput(StreamInput in, java.lang.String source, BufferedChecksumStreamInput reuse) -
BufferedChecksumStreamInput
-
-
Method Details
-
getChecksum
public long getChecksum() -
readByte
public byte readByte() throws java.io.IOExceptionDescription copied from class:StreamInputReads and returns a single byte.- Overrides:
readBytein classFilterStreamInput- Throws:
java.io.IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws java.io.IOExceptionDescription copied from class:StreamInputReads a specified number of bytes into an array at the specified offset.- Overrides:
readBytesin classFilterStreamInput- Parameters:
b- the array to read bytes intooffset- the offset in the array to start storing byteslen- the number of bytes to read- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classFilterStreamInput- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
readin classFilterStreamInput- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classjava.io.InputStream
-
skip
public long skip(long numBytes) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)- Overrides:
markin classjava.io.InputStream
-
resetDigest
public void resetDigest() -
getSource
public java.lang.String getSource()
-