org.apache.cassandra.io.compress

## Class CompressionMetadata.Writer

- java.lang.Object
- - org.apache.cassandra.io.compress.CompressionMetadata.Writer

Enclosing class:
  CompressionMetadata

    public static class CompressionMetadata.Writer
    extends java.lang.Object

### Method Summary

Methods
`void` `addOffset(long offset)`
`long` `chunkOffsetBy(int chunkIndex)` Get a chunk offset by it's index.
`void` `close(long dataLength, int chunks)`
`static CompressionMetadata.Writer` `open(CompressionParameters parameters, java.lang.String path)`
`CompressionMetadata` `openAfterClose(long dataLength, long compressedLength)`
`CompressionMetadata` `openEarly(long dataLength, long compressedLength)`
`void` `resetAndTruncate(int chunkIndex)` Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.

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

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

### Method Detail

#### open

    public static CompressionMetadata.Writer open(CompressionParameters parameters,
                                  java.lang.String path)

#### addOffset

    public void addOffset(long offset)

#### openEarly

    public CompressionMetadata openEarly(long dataLength,
                                long compressedLength)

#### openAfterClose

    public CompressionMetadata openAfterClose(long dataLength,
                                     long compressedLength)

#### chunkOffsetBy

    public long chunkOffsetBy(int chunkIndex)

Get a chunk offset by it's index.

Parameters:
  `chunkIndex` - Index of the chunk.
Returns:
  offset of the chunk in the compressed file.

#### resetAndTruncate

    public void resetAndTruncate(int chunkIndex)

Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.

#### close

    public void close(long dataLength,
             int chunks)
               throws java.io.IOException

Throws:
  `java.io.IOException`