Package nom.tam.fits

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 Details

    • NullData

      public NullData()
  • Method Details

    • fillHeader

      protected void fillHeader(Header head)
      Description copied from class: Data
      Describe the structure of this data object in the supplied header.
      Overrides:
      fillHeader in class ImageData
      Parameters:
      head - header to fill with the data from the current data object
    • loadData

      protected void loadData(ArrayDataInput in)
      Description copied from class: Data

      Load data from the current position of the input into memory. This may be triggered immediately when calling Data.read(ArrayDataInput) if called on a non random accessible input, or else later when data is accessed via Data.ensureData(), for example as a result of a Data.getData() call. This method will not be called unless there is actual data of non-zero size to be read.

      Implementations should create appropriate data structures and populate them from the specified input.

      Overrides:
      loadData in class ImageData
      Parameters:
      in - The input from which to load data
      See Also:
    • getCurrentData

      protected Void getCurrentData()
      Description copied from class: Data
      Returns the data content that is currently in memory. In case of a data object in deferred read state (that is its prescription has been parsed from the header, but no data content was loaded yet from a random accessible input), this call may return null or an object representing empty data.
      Overrides:
      getCurrentData in class ImageData
      Returns:
      The current data content in memory.
      See Also:
    • getTrueSize

      protected long getTrueSize()
      Description copied from class: Data
      Returns the calculated byte size of the data, regardless of whether the data is currently in memory or not.
      Overrides:
      getTrueSize in class ImageData
      Returns:
      the calculated byte size for the data.
    • 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.