Package org.elasticsearch.index.translog
Class BufferedChecksumStreamOutput
- java.lang.Object
-
- java.io.OutputStream
-
- org.elasticsearch.common.io.stream.StreamOutput
-
- org.elasticsearch.index.translog.BufferedChecksumStreamOutput
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public final class BufferedChecksumStreamOutput extends StreamOutput
Similar to Lucene's BufferedChecksumIndexOutput, however this wraps aStreamOutput
so anything written will update the checksum
-
-
Constructor Summary
Constructors Constructor Description BufferedChecksumStreamOutput(StreamOutput out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this stream to further operations.void
flush()
Forces any buffered output to be written.long
getChecksum()
void
reset()
void
resetDigest()
void
writeByte(byte b)
Writes a single byte.void
writeBytes(byte[] b, int offset, int length)
Writes an array of bytes.-
Methods inherited from class org.elasticsearch.common.io.stream.StreamOutput
getVersion, hasFeature, position, seek, setFeatures, setVersion, write, write, writeArray, writeArray, writeBoolean, writeByteArray, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeCollection, writeDouble, writeDoubleArray, writeEnum, writeEnumSet, writeException, writeFloat, writeFloatArray, writeGenericValue, writeGeoPoint, writeInt, writeIntArray, writeList, writeLong, writeLongArray, writeMap, writeMap, writeMapOfLists, writeMapWithConsistentOrder, writeNamedWriteable, writeNamedWriteableList, writeOptionalArray, writeOptionalBoolean, writeOptionalBytesReference, writeOptionalDouble, writeOptionalFloat, writeOptionalLong, writeOptionalNamedWriteable, writeOptionalStreamable, writeOptionalString, writeOptionalStringArray, writeOptionalText, writeOptionalTimeValue, writeOptionalTimeZone, writeOptionalVInt, writeOptionalWriteable, writeShort, writeStreamableList, writeString, writeStringArray, writeStringArrayNullable, writeStringList, writeText, writeTimeValue, writeTimeZone, writeVInt, writeVIntArray, writeVLong, writeVLongArray, writeZLong
-
-
-
-
Constructor Detail
-
BufferedChecksumStreamOutput
public BufferedChecksumStreamOutput(StreamOutput out)
-
-
Method Detail
-
getChecksum
public long getChecksum()
-
writeByte
public void writeByte(byte b) throws java.io.IOException
Description copied from class:StreamOutput
Writes a single byte.- Specified by:
writeByte
in classStreamOutput
- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws java.io.IOException
Description copied from class:StreamOutput
Writes an array of bytes.- Specified by:
writeBytes
in classStreamOutput
- Parameters:
b
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to write- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
Description copied from class:StreamOutput
Forces any buffered output to be written.- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classStreamOutput
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Description copied from class:StreamOutput
Closes this stream to further operations.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classStreamOutput
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
- Specified by:
reset
in classStreamOutput
- Throws:
java.io.IOException
-
resetDigest
public void resetDigest()
-
-