Package nom.tam.util
Class FitsDecoder
java.lang.Object
nom.tam.util.InputDecoder
nom.tam.util.FitsDecoder
- Direct Known Subclasses:
BufferDecoder
Decodes FITS-formatted binary data into Java arrays (primarily for internal use)
- Since:
- 1.16
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new FITS binary data decoder for converting FITS data representations into Java arrays. -
Method Summary
Modifier and TypeMethodDescriptionstatic final booleanbooleanFor(int c) Gets thebooleanequivalent for a FITS byte value representing a logical value.static final BooleanbooleanObjectFor(int c) Gets thebooleanequivalent for a FITS byte value representing a logical value.longSee the contract ofArrayDataInput.readLArray(Object).Methods inherited from class nom.tam.util.InputDecoder
readArrayFully, readImage
-
Constructor Details
-
FitsDecoder
Instantiates a new FITS binary data decoder for converting FITS data representations into Java arrays.- Parameters:
i- the FITS input.
-
-
Method Details
-
booleanFor
public static final boolean booleanFor(int c) Gets thebooleanequivalent for a FITS byte value representing a logical value. This call does not supportnullvalues, which are allowed by the FITS standard, but the similarbooleanObjectFor(int)does. FITS defines 'T' as true, 'F' as false, and 0 as null. However, prior versions of this library have used the value 1 for true, and 0 for false. Therefore, this implementation will recognise both 'T' and 1 astrue, and will returnfalsefor all other byte values.- Parameters:
c- The FITS byte that defines a boolean value- Returns:
trueif and only if the byte is the ASCII character 'T' or has the value of 1, otherwisefalse.- See Also:
-
booleanObjectFor
Gets thebooleanequivalent for a FITS byte value representing a logical value. This call supportsnullvalues, which are allowed by the FITS standard. FITS defines 'T' as true, 'F' as false, and 0 as null. Prior versions of this library have used the value 1 for true, and 0 for false. Therefore, this implementation will recognise both 'T' and 1 astrue, but 0 will map tonulland everything else will returnfalse.- Parameters:
c- The FITS byte that defines a boolean value- Returns:
trueif and only if the byte is the ASCII character 'T' or has the value of 1,nullit the byte is 0, otherwisefalse.- See Also:
-
readArray
Description copied from class:InputDecoderSee the contract ofArrayDataInput.readLArray(Object).- Specified by:
readArrayin classInputDecoder- Parameters:
o- an array, to be populated- Returns:
- the actual number of bytes read from the input, or -1 if already at the end-of-file.
- Throws:
IOException- if there was an IO error reading from the inputIllegalArgumentException- if the argument is not an array or if it contains an element that is not supported for decoding.- See Also:
-