Class NullData

All Implemented Interfaces:
FitsElement

public final class NullData extends ImageData
A subclass of Data containing no actual data. It wraps an underlying data of null.
Since:
1.18
Author:
Attila Kovacs
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates an empty data object for a header-only HDU.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads the data or skips over it for reading later, depending on whether reading from a stream or a random acessible input, respectively.
    void
    Sets the buffer that may hold a serialized version of the data for this image.
    void
    Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.

    Methods inherited from class ImageData

    convertTo, from, getDimensions, getQuantizer, getTiler, getType, isComplexValued, overrideHeaderAxes, setQuantizer, toHDU
    Modifier and Type
    Method
    Description
    convertTo(Class<?> type)
    Converts this image HDU to another image HDU of a different type, possibly using a qunatizer for the integer-decimal conversion of the data elements.
    static ImageData
    from(Object data)
    Creates a new FITS image using the specified primitive numerical Java array containing data.
    final int[]
    Returns the dimensions of this image.
    final Quantizer
    Returns the conversion between decimal and integer data representations.
    Returns the an image tiler instance that can be used to divide this image into tiles that may be processed separately (and in parallel).
    final Class<?>
    Returns the element type of this image in its current representation.
    final boolean
    Checks if the image data is explicitly designated as a complex-valued image.
    static void
    overrideHeaderAxes(Header header, int... sizes)
    (for expert users) Overrides the image size description in the header to the specified Java array dimensions.
    void
    Sets the conversion between decimal and integer data representations.
    Returns an approprotae HDU object that encapsulates this FITS data, and contains the minimal mandatory header description for that data.

    Methods inherited from class Data

    calcChecksum, detach, getData, getFileOffset, getKernel, getSize, isDeferred, isEmpty, reset, rewrite, rewriteable
    Modifier and Type
    Method
    Description
    long
    Computes and returns the FITS checksum for this data, for example to compare against the stored DATASUM in the FITS header (e.g. via BasicHDU.getStoredDatasum()).
    void
    Detaches this data object from the input (if any), such as a file or stream, but not before loading data from the previously assigned input into memory.
    Returns the underlying Java representation of the data contained in this HDU's data segment.
    long
    Returns the byte offset at which this element starts ina file.
    final Object
    long
    Returns the size of this elements in the FITS representation.
    boolean
    Checks if the data should be assumed to be in deferred read mode.
    boolean
    Checks if the data content is currently empty, i.e. no actual data is currently stored in memory.
    boolean
    Reset the input stream to point to the beginning of this element
    void
    Rewrite the contents of the element in place.
    boolean
    Checks if we can write this element back to its source.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NullData

      public NullData()
      Instantiates an empty data object for a header-only HDU.
  • Method Details

    • read

      public void read(ArrayDataInput in)
      Description copied from class: Data

      Reads the data or skips over it for reading later, depending on whether reading from a stream or a random acessible input, respectively.

      In case the argument is a an instance of RandomAccess input (such as a FitsFile, the call will simply note where in the file the data segment can be found for reading at a later point, only when the data content is accessed. This 'deferred' reading behavior make it possible to process large HDUs even with small amount of RAM, and can result in a significant performance boost when inspectring large FITS files, or using only select content from large FITS files.

      Specified by:
      read in interface FitsElement
      Overrides:
      read in class ImageData
      Parameters:
      in - The input data stream
      See Also:
    • write

      public void write(ArrayDataOutput o)
      Description copied from interface: FitsElement
      Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.
      Specified by:
      write in interface FitsElement
      Overrides:
      write in class ImageData
      Parameters:
      o - The data sink.
    • setBuffer

      public void setBuffer(Buffer data)
      Description copied from class: ImageData
      Sets the buffer that may hold a serialized version of the data for this image.
      Overrides:
      setBuffer in class ImageData
      Parameters:
      data - the buffer that may hold this image's data in serialized form.