Class NullData
- All Implemented Interfaces:
FitsElement
Data
containing no actual data. It wraps an underlying data of null
.- Since:
- 1.18
- Author:
- Attila Kovacs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class nom.tam.fits.ImageData
ImageData.ArrayDesc, ImageData.ImageDataTiler
-
Field Summary
Fields inherited from class nom.tam.fits.Data
dataSize, fileOffset, input
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
fillHeader
(Header head) Describe the structure of this data object in the supplied header.protected Void
Returns the data content that is currently in memory.protected long
Returns the calculated byte size of the data, regardless of whether the data is currently in memory or not.protected void
Load data from the current position of the input into memory.void
read
(ArrayDataInput in) 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 nom.tam.fits.ImageData
convertTo, from, getDimensions, getQuantizer, getTiler, getType, isComplexValued, overrideHeaderAxes, parseHeader, setQuantizer, toHDU
Methods inherited from class nom.tam.fits.Data
calcChecksum, detach, ensureData, getData, getFileOffset, getKernel, getRandomAccessInput, getSize, isDeferred, isEmpty, reset, rewrite, rewriteable, setFileOffset
-
Constructor Details
-
NullData
public NullData()
-
-
Method Details
-
fillHeader
Description copied from class:Data
Describe the structure of this data object in the supplied header.- Overrides:
fillHeader
in classImageData
- Parameters:
head
- header to fill with the data from the current data object
-
loadData
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 viaData.ensureData()
, for example as a result of aData.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.
-
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 returnnull
or an object representing empty data.- Overrides:
getCurrentData
in classImageData
- 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 classImageData
- Returns:
- the calculated byte size for the data.
-
read
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 aFitsFile
, 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 interfaceFitsElement
- Overrides:
read
in classImageData
- Parameters:
in
- The input data stream- See Also:
-
write
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 interfaceFitsElement
- Overrides:
write
in classImageData
- Parameters:
o
- The data sink.
-
setBuffer
Description copied from class:ImageData
Sets the buffer that may hold a serialized version of the data for this image.
-