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 voidfillHeader(Header head) Describe the structure of this data object in the supplied header.protected VoidReturns the data content that is currently in memory.protected longReturns the calculated byte size of the data, regardless of whether the data is currently in memory or not.protected voidLoad data from the current position of the input into memory.voidread(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.voidSets the buffer that may hold a serialized version of the data for this image.voidWrites 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, toHDUMethods 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:DataDescribe the structure of this data object in the supplied header.- Overrides:
fillHeaderin classImageData- Parameters:
head- header to fill with the data from the current data object
-
loadData
Description copied from class:DataLoad 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:DataReturns 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 returnnullor an object representing empty data.- Overrides:
getCurrentDatain classImageData- Returns:
- The current data content in memory.
- See Also:
-
getTrueSize
protected long getTrueSize()Description copied from class:DataReturns the calculated byte size of the data, regardless of whether the data is currently in memory or not.- Overrides:
getTrueSizein classImageData- Returns:
- the calculated byte size for the data.
-
read
Description copied from class:DataReads 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
RandomAccessinput (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:
readin interfaceFitsElement- Overrides:
readin classImageData- Parameters:
in- The input data stream- See Also:
-
write
Description copied from interface:FitsElementWrites 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:
writein interfaceFitsElement- Overrides:
writein classImageData- Parameters:
o- The data sink.
-
setBuffer
Description copied from class:ImageDataSets the buffer that may hold a serialized version of the data for this image.
-