org.apache.lucene.codecs

## Class CompoundFormat

- java.lang.Object
- - org.apache.lucene.codecs.CompoundFormat

Direct Known Subclasses:
  Lucene50CompoundFormat

    public abstract class CompoundFormat
    extends Object

Encodes/decodes compound files

WARNING: This API is experimental and might change in incompatible ways in the next release.

### Constructor Summary

Constructors
Constructor and Description
`CompoundFormat()` Sole constructor.

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract Directory` `getCompoundReader(Directory dir, SegmentInfo si, IOContext context)` Returns a Directory view (read-only) for the compound files in this segment
`abstract void` `write(Directory dir, SegmentInfo si, IOContext context)` Packs the provided segment's files into a compound format.

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

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

### Constructor Detail

#### CompoundFormat

    public CompoundFormat()

Sole constructor. (For invocation by subclass constructors, typically implicit.)

### Method Detail

#### getCompoundReader

    public abstract Directory getCompoundReader(Directory dir,
                                                SegmentInfo si,
                                                IOContext context)
                                         throws IOException

Returns a Directory view (read-only) for the compound files in this segment

Throws:
  `IOException`

#### write

    public abstract void write(Directory dir,
                               SegmentInfo si,
                               IOContext context)
                        throws IOException

Packs the provided segment's files into a compound format. All files referenced by the provided `SegmentInfo` must have `CodecUtil.writeIndexHeader(org.apache.lucene.store.DataOutput, java.lang.String, int, byte[], java.lang.String)` and `CodecUtil.writeFooter(org.apache.lucene.store.IndexOutput)`.

Throws:
  `IOException`