public class IntegerAdapter extends Object implements DataTypeAdapter
Constructor and Description |
---|
IntegerAdapter(int elementSize,
boolean isBigEndian,
boolean isUnsigned)
Creates a new adapter for an integer of given size.
|
Modifier and Type | Method and Description |
---|---|
double |
getDouble(ByteBuffer buf)
Gets the value as a double.
|
int |
getInt(ByteBuffer buf)
Gets the value as an int.
|
long |
getLong(ByteBuffer buf)
Gets the value as a long.
|
public IntegerAdapter(int elementSize, boolean isBigEndian, boolean isUnsigned)
elementSize
- the number of bytes in the integerisBigEndian
- true, if the data is big-endian, false if little-endianisUnsigned
- true, if the data is unsigned, false if signedpublic int getInt(ByteBuffer buf)
DataTypeAdapter
getInt
in interface DataTypeAdapter
buf
- the buffer from which to get the valuepublic long getLong(ByteBuffer buf)
DataTypeAdapter
getLong
in interface DataTypeAdapter
buf
- the buffer from which to get the valuepublic double getDouble(ByteBuffer buf)
DataTypeAdapter
getDouble
in interface DataTypeAdapter
buf
- the buffer from which to get the valueCopyright © 2010–2018 Planetary Data System. All rights reserved.