Package org.apache.lucene.tests.store
Class CorruptingIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.tests.store.CorruptingIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class CorruptingIndexOutput extends IndexOutput
Corrupts on bit of a file after close
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexOutputout
-
Constructor Summary
Constructors Constructor Description CorruptingIndexOutput(Directory dir, long byteToCorrupt, IndexOutput out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidcorruptFile()longgetChecksum()longgetFilePointer()StringgetName()StringtoString()voidwriteByte(byte b)voidwriteBytes(byte[] b, int offset, int length)-
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset
-
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
Field Detail
-
out
protected final IndexOutput out
-
-
Constructor Detail
-
CorruptingIndexOutput
public CorruptingIndexOutput(Directory dir, long byteToCorrupt, IndexOutput out)
-
-
Method Detail
-
getName
public String getName()
- Overrides:
getNamein classIndexOutput
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classIndexOutput- Throws:
IOException
-
corruptFile
protected void corruptFile() throws IOException- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointerin classIndexOutput
-
getChecksum
public long getChecksum() throws IOException- Specified by:
getChecksumin classIndexOutput- Throws:
IOException
-
toString
public String toString()
- Overrides:
toStringin classIndexOutput
-
writeByte
public void writeByte(byte b) throws IOException- Specified by:
writeBytein classDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Specified by:
writeBytesin classDataOutput- Throws:
IOException
-
-