Package noaa.coastwatch.io
Class ShortWriter
java.lang.Object
noaa.coastwatch.io.EarthDataWriter
noaa.coastwatch.io.BinaryWriter
noaa.coastwatch.io.ShortWriter
A short writer is a binary writer that writes data as a stream of
16-bit signed integers.
- Since:
- 3.1.0
- Author:
- Mark Robinson
-
Field Summary
Fields inherited from class noaa.coastwatch.io.BinaryWriter
DEFAULT_CHUNK_SIZE, HOST, LSB, MSB
Fields inherited from class noaa.coastwatch.io.EarthDataWriter
info, isCanceled, variables, writeProgress, writeVariableName, writeVariables
-
Constructor Summary
ConstructorDescriptionShortWriter
(EarthDataInfo info, String file) Creates a new binary file from the specified earth data info and file name. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertValue
(Number value) Converts a data value to a byte array.Gets the default missing value.double
Gets the type maximum as a double.double
Gets the type minimum as a double.double
Gets the type range as a double.Methods inherited from class noaa.coastwatch.io.BinaryWriter
byteSwap, close, flush, getBytes, getBytes, setHeader, setMissing, setOrder, setRange, setScaling, writeHeader, writeVariable
Methods inherited from class noaa.coastwatch.io.EarthDataWriter
addVariable, cancel, finalize, getDestination, getProgress, getProgressLength, getProgressVariable
-
Constructor Details
-
ShortWriter
Creates a new binary file from the specified earth data info and file name.- Parameters:
info
- the earth data info object.file
- the new binary file name.- Throws:
IOException
- if an error occurred opening the file.- See Also:
-
-
Method Details
-
convertValue
Description copied from class:BinaryWriter
Converts a data value to a byte array. The byte array has a length appropriate for the subclass. The value must be in the rangegetTypeMin()
togetTypeMax()
.- Specified by:
convertValue
in classBinaryWriter
- Parameters:
value
- the value for conversion.- Returns:
- an array of bytes.
-
getTypeMin
public double getTypeMin()Description copied from class:BinaryWriter
Gets the type minimum as a double.- Specified by:
getTypeMin
in classBinaryWriter
-
getTypeMax
public double getTypeMax()Description copied from class:BinaryWriter
Gets the type maximum as a double.- Specified by:
getTypeMax
in classBinaryWriter
-
getTypeRange
public double getTypeRange()Description copied from class:BinaryWriter
Gets the type range as a double.- Specified by:
getTypeRange
in classBinaryWriter
-
getDefaultMissing
Description copied from class:BinaryWriter
Gets the default missing value.- Specified by:
getDefaultMissing
in classBinaryWriter
-