FileBasedScatterGatherBackingStore
Date: 2017-02-08

org.apache.commons.compress.parallel

## Class FileBasedScatterGatherBackingStore

- java.lang.Object
- - org.apache.commons.compress.parallel.FileBasedScatterGatherBackingStore

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ScatterGatherBackingStore

      public class FileBasedScatterGatherBackingStore
      extends java.lang.Object
      implements ScatterGatherBackingStore

  ScatterGatherBackingStore that is backed by a file.
  Since:
    1.10

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileBasedScatterGatherBackingStore(java.io.File target)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `closeForWriting()` Closes this backing store for further writing.
    `java.io.InputStream` | `getInputStream()` An input stream that contains the scattered payload
    `void` | `writeOut(byte[] data, int offset, int length)` Writes a piece of payload.

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

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

- - ### Constructor Detail

    - #### FileBasedScatterGatherBackingStore

          public FileBasedScatterGatherBackingStore(java.io.File target)
                                             throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

  - ### Method Detail

    - #### getInputStream

          public java.io.InputStream getInputStream()
                                             throws java.io.IOException

      Description copied from interface: `ScatterGatherBackingStore`
      An input stream that contains the scattered payload
      Specified by:
        `getInputStream` in interface `ScatterGatherBackingStore`
      Returns:
        An InputStream, should be closed by the caller of this method.
      Throws:
        `java.io.IOException` - when something fails

    - #### closeForWriting

          public void closeForWriting()
                               throws java.io.IOException

      Description copied from interface: `ScatterGatherBackingStore`
      Closes this backing store for further writing.
      Specified by:
        `closeForWriting` in interface `ScatterGatherBackingStore`
      Throws:
        `java.io.IOException` - when something fails

    - #### writeOut

          public void writeOut(byte[] data,
                      int offset,
                      int length)
                        throws java.io.IOException

      Description copied from interface: `ScatterGatherBackingStore`
      Writes a piece of payload.
      Specified by:
        `writeOut` in interface `ScatterGatherBackingStore`
      Parameters:
        `data` - the data to write
        `offset` - offset inside data to start writing from
        `length` - the amount of data to write
      Throws:
        `java.io.IOException` - when something fails

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `java.io.IOException`