Class CompressedTableData

All Implemented Interfaces:
Cloneable, FitsElement, TableData

public class CompressedTableData extends BinaryTable
FITS representation of a compressed binary table. It itself is a binary table, but one in which each row represents the compressed image of one or more rows of the original table.
See Also:
  • Constructor Details

    • CompressedTableData

      public CompressedTableData()
      Creates a new empty compressed table data to be initialized at a later point
    • CompressedTableData

      public CompressedTableData(Header header) throws FitsException
      Creates a new compressed table data based on the prescription of the supplied header.
      Parameters:
      header - The header that describes the compressed table
      Throws:
      FitsException - If the header is invalid or could not be accessed.
  • Method Details

    • compress

      public void compress(Header header) throws FitsException
      (for internal use) This should only be called by CompressedTableHDU, and should have reduced visibility accordingly.
      Parameters:
      header - the compressed header
      Throws:
      FitsException - if the table cannot be compressed.
    • defragment

      public long defragment() throws FitsException
      Description copied from class: BinaryTable

      Defragments the heap area of this table, compacting the heap area, and returning the number of bytes by which the heap size has been reduced. When tables with variable-sized columns are modified, the heap may retain old data as columns are removed or elements get replaced with new data of different size. The data order in the heap may also get jumbled, causing what would appear to be sequential reads to jump all over the heap space with the caching. And, depending on how the heap was constructed in the first place, it may not be optimal for the row-after-row table access that is the most typical use case.

      This method rebuilds the heap by taking elements in table read order (by rows, and columns) and puts them on a new heap.

      For best squential read performance, you should defragment all tables that have been built column-by-column before writing them to a FITS file. The only time defragmentation is really not needed is if the table was built row-by-row, with no modifications to variable-length content after the fact.

      Overrides:
      defragment in class BinaryTable
      Returns:
      the number of bytes by which the heap has shrunk as a result of defragmentation.
      Throws:
      FitsException - if there was an error accessing the heap or the main data table comntaining the heap locators. In case of an error the table content may be left in a damaged state.
      See Also:
    • fillHeader

      public void fillHeader(Header h) throws FitsException
      Overrides:
      fillHeader in class BinaryTable
      Throws:
      FitsException
    • prepareUncompressedData

      public void prepareUncompressedData(ColumnTable<?> data) throws FitsException
      Deprecated.
      (for internal use) This should only be called by CompressedTableHDU, and its visibility will be reduced accordingly in the future, not to mention that it should take a BinaryTable as its argument.
      Parameters:
      data - The original (uncompressed) table data.
      Throws:
      FitsException