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 and Description
    --- | ---
    `protected IndexOutput` | `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CorruptingIndexOutput(Directory dir, long byteToCorrupt, IndexOutput out)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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 class `IndexOutput`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `IndexOutput`
      Throws:
        `IOException`

    - #### corruptFile

          protected void corruptFile()
                              throws IOException

      Throws:
        `IOException`

    - #### getFilePointer

          public long getFilePointer()

      Specified by:
        `getFilePointer` in class `IndexOutput`

    - #### getChecksum

          public long getChecksum()
                           throws IOException

      Specified by:
        `getChecksum` in class `IndexOutput`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `IndexOutput`

    - #### writeByte

          public void writeByte(byte b)
                         throws IOException

      Specified by:
        `writeByte` in class `DataOutput`
      Throws:
        `IOException`

    - #### writeBytes

          public void writeBytes(byte[] b,
                                 int offset,
                                 int length)
                          throws IOException

      Specified by:
        `writeBytes` in class `DataOutput`
      Throws:
        `IOException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.