Package org.apache.lucene.store
Class CorruptingIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.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 IndexOutput
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 void
close()
protected void
corruptFile()
long
getChecksum()
long
getFilePointer()
String
getName()
String
toString()
void
writeByte(byte b)
void
writeBytes(byte[] b, int offset, int length)
-
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:
getName
in classIndexOutput
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classIndexOutput
- Throws:
IOException
-
corruptFile
protected void corruptFile() throws IOException
- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointer
in classIndexOutput
-
getChecksum
public long getChecksum() throws IOException
- Specified by:
getChecksum
in classIndexOutput
- Throws:
IOException
-
toString
public String toString()
- Overrides:
toString
in classIndexOutput
-
writeByte
public void writeByte(byte b) throws IOException
- Specified by:
writeByte
in classDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException
- Specified by:
writeBytes
in classDataOutput
- Throws:
IOException
-
-