Package org.apache.lucene.tests.store
Class CorruptingIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.store.FilterIndexOutput
-
- org.apache.lucene.tests.store.CorruptingIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class CorruptingIndexOutput extends FilterIndexOutput
Corrupts on bit of a file after close
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.store.FilterIndexOutput
out
-
-
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()StringgetName()voidwriteBytes(byte[] b, int offset, int length)-
Methods inherited from class org.apache.lucene.store.FilterIndexOutput
getDelegate, getFilePointer, unwrap, writeByte
-
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, toString
-
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
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- Overrides:
closein classFilterIndexOutput- Throws:
IOException
-
corruptFile
protected void corruptFile() throws IOException- Throws:
IOException
-
getChecksum
public long getChecksum() throws IOException- Overrides:
getChecksumin classFilterIndexOutput- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Overrides:
writeBytesin classFilterIndexOutput- Throws:
IOException
-
-