org.apache.lucene.store

## Class MockIndexOutputWrapper

- java.lang.Object
- - org.apache.lucene.store.DataOutput
  - - org.apache.lucene.store.IndexOutput
    - - org.apache.lucene.store.MockIndexOutputWrapper

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class MockIndexOutputWrapper
      extends IndexOutput

  Used by MockRAMDirectory to create an output stream that will throw an IOException on fake disk full, track max disk space actually used, and maybe throw random IOExceptions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockIndexOutputWrapper(MockDirectoryWrapper dir, IndexOutput delegate, String name)` Construct an empty output buffer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `copyBytes(DataInput input, long numBytes)`
    `long` | `getChecksum()`
    `long` | `getFilePointer()`
    `String` | `toString()`
    `void` | `writeByte(byte b)`
    `void` | `writeBytes(byte[] b, int offset, int len)`

    - ### Methods inherited from class org.apache.lucene.store.IndexOutput

      `getName`

    - ### Methods inherited from class org.apache.lucene.store.DataOutput

      `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`

- - ### Constructor Detail

    - #### MockIndexOutputWrapper

          public MockIndexOutputWrapper(MockDirectoryWrapper dir,
                                        IndexOutput delegate,
                                        String name)

      Construct an empty output buffer.

  - ### Method Detail

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

    - #### 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 len)
                          throws IOException

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

    - #### getFilePointer

          public long getFilePointer()

      Specified by:
        `getFilePointer` in class `IndexOutput`

    - #### copyBytes

          public void copyBytes(DataInput input,
                                long numBytes)
                         throws IOException

      Overrides:
        `copyBytes` in class `DataOutput`
      Throws:
        `IOException`

    - #### getChecksum

          public long getChecksum()
                           throws IOException

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `IndexOutput`

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