uk.ac.starlink.fits
Class VariableFitsTableSerializer

java.lang.Object
  extended by uk.ac.starlink.fits.StandardFitsTableSerializer
      extended by uk.ac.starlink.fits.VariableFitsTableSerializer
All Implemented Interfaces:
FitsTableSerializer

public class VariableFitsTableSerializer
extends StandardFitsTableSerializer

FitsTableSerializer which can write variable array-valued columns using the 'P' or 'Q' TFORM formatting characters.

Since:
10 Jul 2008

Constructor Summary
VariableFitsTableSerializer(StarTable table, StoragePolicy storagePolicy, boolean allowSignedByte, WideFits wide)
          Constructor.
 
Method Summary
 nom.tam.fits.Header getHeader()
          Returns a header suitable for the HDU which will contain the table.
 void set64BitMode(boolean useQ)
          Sets whether this serializer should use the 'P' descriptor (32-bit addressing into the heap) or the 'Q' descriptor (64-bit addressing into the heap) for variable-length array columns.
 void writeData(DataOutput out)
          Writes the HDU data for the table to an output stream.
 
Methods inherited from class uk.ac.starlink.fits.StandardFitsTableSerializer
getBadValue, getDimensions, getFormatChar, getRowCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableFitsTableSerializer

public VariableFitsTableSerializer(StarTable table,
                                   StoragePolicy storagePolicy,
                                   boolean allowSignedByte,
                                   WideFits wide)
                            throws IOException
Constructor.

Parameters:
table - table to write
storagePolicy - policy for acquiring byte array scratch buffers
allowSignedByte - if true, bytes written as FITS signed bytes (TZERO=-128), if false bytes written as signed shorts
wide - convention for representing over-wide tables; null to avoid this convention
Throws:
IOException - if it won't be possible to write the given table
Method Detail

set64BitMode

public void set64BitMode(boolean useQ)
Sets whether this serializer should use the 'P' descriptor (32-bit addressing into the heap) or the 'Q' descriptor (64-bit addressing into the heap) for variable-length array columns. Normally Q is only used if the heap is larger than 2^31.

Parameters:
useQ - true for Q, false for P

getHeader

public nom.tam.fits.Header getHeader()
                              throws nom.tam.fits.HeaderCardException
Description copied from interface: FitsTableSerializer
Returns a header suitable for the HDU which will contain the table.

Specified by:
getHeader in interface FitsTableSerializer
Overrides:
getHeader in class StandardFitsTableSerializer
Returns:
header object
Throws:
nom.tam.fits.HeaderCardException

writeData

public void writeData(DataOutput out)
               throws IOException
Description copied from interface: FitsTableSerializer
Writes the HDU data for the table to an output stream.

Specified by:
writeData in interface FitsTableSerializer
Overrides:
writeData in class StandardFitsTableSerializer
Parameters:
out - destination stream
Throws:
IOException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.