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
Fields inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
delegate
-
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 long
getChecksum()
java.lang.String
getSource()
void
mark(int readlimit)
boolean
markSupported()
int
read()
byte
readByte()
Reads and returns a single byte.void
readBytes(byte[] b, int offset, int len)
Reads a specified number of bytes into an array at the specified offset.int
readInt()
Reads four bytes and returns an int.long
readLong()
Reads eight bytes and returns a long.short
readShort()
void
reset()
void
resetDigest()
long
skip(long numBytes)
Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, namedWriteableRegistry, readReleasableBytesReference, setVersion
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readArraySize, readBigInteger, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readImmutableMap, readInstant, readIntArray, readList, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalEnum, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringList, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readOrderedMap, readSecureString, readSet, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, readZoneId, wrap, wrap
Methods inherited from class java.io.InputStream
nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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:StreamInput
Reads and returns a single byte.- Overrides:
readByte
in classFilterStreamInput
- Throws:
java.io.IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws java.io.IOExceptionDescription copied from class:StreamInput
Reads a specified number of bytes into an array at the specified offset.- Overrides:
readBytes
in 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
-
readShort
public short readShort() throws java.io.IOException- Overrides:
readShort
in classFilterStreamInput
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOExceptionDescription copied from class:StreamInput
Reads four bytes and returns an int.- Overrides:
readInt
in classFilterStreamInput
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOExceptionDescription copied from class:StreamInput
Reads eight bytes and returns a long.- Overrides:
readLong
in classFilterStreamInput
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
reset
in classFilterStreamInput
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
read
in classFilterStreamInput
- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classjava.io.InputStream
-
skip
public long skip(long numBytes) throws java.io.IOException- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)- Overrides:
mark
in classjava.io.InputStream
-
resetDigest
public void resetDigest() -
getSource
public java.lang.String getSource()
-