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, MSBFields inherited from class noaa.coastwatch.io.EarthDataWriter
info, isCanceled, variables, writeProgress, writeVariableName, writeVariables -
Constructor Summary
ConstructorsConstructorDescriptionShortWriter(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.doubleGets the type maximum as a double.doubleGets the type minimum as a double.doubleGets 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, writeVariableMethods 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:BinaryWriterConverts 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:
convertValuein classBinaryWriter- Parameters:
value- the value for conversion.- Returns:
- an array of bytes.
-
getTypeMin
public double getTypeMin()Description copied from class:BinaryWriterGets the type minimum as a double.- Specified by:
getTypeMinin classBinaryWriter
-
getTypeMax
public double getTypeMax()Description copied from class:BinaryWriterGets the type maximum as a double.- Specified by:
getTypeMaxin classBinaryWriter
-
getTypeRange
public double getTypeRange()Description copied from class:BinaryWriterGets the type range as a double.- Specified by:
getTypeRangein classBinaryWriter
-
getDefaultMissing
Description copied from class:BinaryWriterGets the default missing value.- Specified by:
getDefaultMissingin classBinaryWriter
-