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 aStreamInput
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
All Methods Instance Methods Concrete Methods 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.void
reset()
void
resetDigest()
long
skip(long numBytes)
-
Methods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, close, ensureCanReadBytes, getVersion, setVersion
-
Methods 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, readInt, readIntArray, readList, readLong, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalFloat, readOptionalLong, readOptionalNamedWriteable, readOptionalStreamable, readOptionalString, readOptionalStringArray, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalWriteable, readSet, readShort, readStreamableList, readString, readStringArray, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, wrap, wrap
-
-
-
-
Constructor Detail
-
BufferedChecksumStreamInput
public BufferedChecksumStreamInput(StreamInput in, java.lang.String source, BufferedChecksumStreamInput reuse)
-
BufferedChecksumStreamInput
public BufferedChecksumStreamInput(StreamInput in, java.lang.String source)
-
-
Method Detail
-
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 classFilterStreamInput
- 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 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:
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()
-
-