Package uk.ac.starlink.votable

# Class ColFitsPlusTableBuilder

java.lang.Object
uk.ac.starlink.votable.ColFitsPlusTableBuilder

All Implemented Interfaces:
  `uk.ac.starlink.table.TableBuilder`

public class ColFitsPlusTableBuilder extends Object implements uk.ac.starlink.table.TableBuilder
Implementation of the `TableBuilder` interface which reads tables stored in column-oriented FITS binary table format. The table data is stored in a BINTABLE extension which has a single row; each cell in this row contains the data for an entire column of the represented table. The primary HDU contains a byte[] array giving the table metadata as a VOTable, as for `FitsPlusTableBuilder`. If the VOTMETA card in the primary HDU does not have the value T, the VOTable metadata array is ignored.

This rather specialised format may provide good performance for certain operations on very large, especially very wide, tables. Although it is FITS and can therefore be used in principle for data interchange, in practice most non-STIL processors are unlikely to be able to do much useful with it.

Since:
  26 Jun 2006
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ColFitsPlusTableBuilder()`
Default constructor.
`ColFitsPlusTableBuilder(uk.ac.starlink.fits.WideFits wide)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canImport(DataFlavor flavor)`
`String`
`getFormatName()`
`static boolean`
`isMagic(byte[] buffer)`
Tests whether a given buffer contains bytes which might be the first few bytes of a FitsPlus table.
`boolean`
`looksLikeFile(String location)`
`uk.ac.starlink.table.StarTable`
`makeStarTable(uk.ac.starlink.util.DataSource datsrc, boolean wantRandom, uk.ac.starlink.table.StoragePolicy policy)`
`void`
`streamStarTable(InputStream in, uk.ac.starlink.table.TableSink sink, String pos)`

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

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

## Constructor Details

### ColFitsPlusTableBuilder

public ColFitsPlusTableBuilder()
Default constructor.

### ColFitsPlusTableBuilder

public ColFitsPlusTableBuilder(uk.ac.starlink.fits.WideFits wide)
Constructor.

Parameters:
  `wide` - convention for representing extended columns; use null to avoid use of extended columns

## Method Details

### getFormatName

public String getFormatName()

Specified by:
  `getFormatName` in interface `uk.ac.starlink.table.TableBuilder`

### looksLikeFile

public boolean looksLikeFile(String location)

Specified by:
  `looksLikeFile` in interface `uk.ac.starlink.table.TableBuilder`

### streamStarTable

public void streamStarTable(InputStream in, uk.ac.starlink.table.TableSink sink, String pos) throws uk.ac.starlink.table.TableFormatException

Specified by:
  `streamStarTable` in interface `uk.ac.starlink.table.TableBuilder`
Throws:
  `uk.ac.starlink.table.TableFormatException`

### canImport

public boolean canImport(DataFlavor flavor)

Specified by:
  `canImport` in interface `uk.ac.starlink.table.TableBuilder`

### makeStarTable

public uk.ac.starlink.table.StarTable makeStarTable(uk.ac.starlink.util.DataSource datsrc, boolean wantRandom, uk.ac.starlink.table.StoragePolicy policy) throws IOException

Specified by:
  `makeStarTable` in interface `uk.ac.starlink.table.TableBuilder`
Throws:
  `IOException`

### isMagic

public static boolean isMagic(byte[] buffer)
Tests whether a given buffer contains bytes which might be the first few bytes of a FitsPlus table. The criterion is that it looks like the start of a FITS header, and the first few cards look roughly like this:

         SIMPLE  =              T
         BITPIX  =              8
         NAXIS   =              1
         NAXIS1  =            ???
         COLFITS =              T
         VOTMETA =              T

Parameters:
  `buffer` - byte buffer containing leading few bytes of data
Returns:
  true if it looks like a FitsPlus file