loci.formats.codec

## Class TargaRLECodec

- java.lang.Object
- - loci.formats.codec.BaseCodec
  - - loci.formats.codec.TargaRLECodec

- All Implemented Interfaces:
    Codec

      public class TargaRLECodec
      extends BaseCodec

  This class implements Targa RLE decompression. Compression is not yet implemented.
  Author:
    Melissa Linkert melissa at glencoesoftware.com

- - ### Field Summary

    - ### Fields inherited from class loci.formats.codec.BaseCodec

      `LOGGER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TargaRLECodec()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `compress(byte[] data, CodecOptions options)` Compresses a block of data.
    `byte[]` | `decompress(loci.common.RandomAccessInputStream in, CodecOptions options)` The CodecOptions parameter should have the following fields set: `maxBytes` `CodecOptions.bitsPerSample`

    - ### Methods inherited from class loci.formats.codec.BaseCodec

      `compress, decompress, decompress, decompress, decompress, test`

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

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

- - ### Constructor Detail

    - #### TargaRLECodec

          public TargaRLECodec()

  - ### Method Detail

    - #### compress

          public byte[] compress(byte[] data,
                                 CodecOptions options)
                          throws FormatException

      Description copied from interface: `Codec`
      Compresses a block of data.
      Parameters:
        `data` - The data to be compressed.
        `options` - Options to be used during compression, if appropriate.
      Returns:
        The compressed data.
      Throws:
        `FormatException` - If input is not a compressed data block of the appropriate type.

    - #### decompress

          public byte[] decompress(loci.common.RandomAccessInputStream in,
                                   CodecOptions options)
                            throws FormatException,
                                   java.io.IOException

      The CodecOptions parameter should have the following fields set: `maxBytes` `CodecOptions.bitsPerSample`
      Specified by:
        `decompress` in interface `Codec`
      Specified by:
        `decompress` in class `BaseCodec`
      Parameters:
        `in` - The stream from which to read compressed data.
        `options` - Options to be used during decompression.
      Returns:
        The decompressed data.
      Throws:
        `FormatException` - If data is not valid compressed data for this decompressor.
        `java.io.IOException`
      See Also:
        `Codec.decompress(RandomAccessInputStream, CodecOptions)`

Copyright © 2026 Open Microscopy Environment