Package org.geotools.data.vpf.util
Class DataUtils
- Object
-
- DataUtils
-
- All Implemented Interfaces:
DataTypesDefinition
public class DataUtils extends Object implements DataTypesDefinition
Class DataUtils.java is responsible for a bunch of miscellaneous operations for reading and converting dataCreated: Wed Jan 29 10:06:37 2003
- Author:
- Artur Hefczyc
-
-
Field Summary
-
Fields inherited from interface DataTypesDefinition
BIG_ENDIAN_ORDER, CHAR_NULL_VALUE, DATA_2_COORD_F, DATA_2_COORD_F_LEN, DATA_2_COORD_R, DATA_2_COORD_R_LEN, DATA_3_COORD_F, DATA_3_COORD_F_LEN, DATA_3_COORD_R, DATA_3_COORD_R_LEN, DATA_DATE_TIME, DATA_DATE_TIME_LEN, DATA_LEVEL1_TEXT, DATA_LEVEL2_TEXT, DATA_LEVEL3_TEXT, DATA_LONG_FLOAT, DATA_LONG_FLOAT_LEN, DATA_LONG_INTEGER, DATA_LONG_INTEGER_LEN, DATA_NULL_FIELD, DATA_NULL_FIELD_LEN, DATA_SHORT_FLOAT, DATA_SHORT_FLOAT_LEN, DATA_SHORT_INTEGER, DATA_SHORT_INTEGER_LEN, DATA_TEXT, DATA_TRIPLET_ID, DATA_TRIPLET_ID_LEN, LEAST_SIGNIF_FIRST, LITTLE_ENDIAN_ORDER, MOST_SIGNIF_FIRST, STRING_NULL_VALUE, STRING_NULL_VALUES
-
-
Constructor Summary
Constructors Constructor Description DataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyArrays(byte[] dest, byte[] source, int fromIdx)
DescribecopyArrays
method here.static Object
decodeData(byte[] bytes, char type)
DescribedecodeData
method here.static double
decodeDouble(byte[] bytes)
DescribedecodeDouble
method here.static float
decodeFloat(byte[] bytes)
DescribedecodeFloat
method here.static int
decodeInt(byte[] bytes)
DescribedecodeInt
method here.static short
decodeShort(byte[] bytes)
DescribedecodeShort
method here.static int
getDataTypeSize(char type)
DescribegetDataTypeSize
method here.static boolean
isNumeric(char type)
DescribeisNumeric
method here.static int
littleEndianToInt(byte[] fourBytes)
static byte[]
toBigEndian(byte[] source)
Converts the provided array to big endian.static int
unsigByteToInt(byte b)
DescribeunsigByteToInt
method here.
-
-
-
Method Detail
-
toBigEndian
public static byte[] toBigEndian(byte[] source)
Converts the provided array to big endian.As java is BigEndian the implementation just makes a copy.
- Parameters:
source
- abyte[]
value- Returns:
- a
byte[]
value
-
decodeData
public static Object decodeData(byte[] bytes, char type)
DescribedecodeData
method here.- Parameters:
bytes
- abyte[]
valuetype
- achar
value- Returns:
- an
Object
value
-
copyArrays
public static void copyArrays(byte[] dest, byte[] source, int fromIdx)
DescribecopyArrays
method here.- Parameters:
dest
- abyte[]
valuesource
- abyte[]
valuefromIdx
- anint
value
-
decodeShort
public static short decodeShort(byte[] bytes)
DescribedecodeShort
method here.- Parameters:
bytes
- abyte[]
value- Returns:
- a
short
value
-
littleEndianToInt
public static int littleEndianToInt(byte[] fourBytes)
-
decodeInt
public static int decodeInt(byte[] bytes)
DescribedecodeInt
method here.- Parameters:
bytes
- abyte[]
value- Returns:
- an
int
value
-
decodeFloat
public static float decodeFloat(byte[] bytes)
DescribedecodeFloat
method here.- Parameters:
bytes
- abyte[]
value- Returns:
- a
float
value
-
decodeDouble
public static double decodeDouble(byte[] bytes)
DescribedecodeDouble
method here.- Parameters:
bytes
- abyte[]
value- Returns:
- a
double
value
-
unsigByteToInt
public static int unsigByteToInt(byte b)
DescribeunsigByteToInt
method here.- Parameters:
b
- abyte
value- Returns:
- an
int
value
-
getDataTypeSize
public static int getDataTypeSize(char type)
DescribegetDataTypeSize
method here.- Parameters:
type
- achar
value- Returns:
- an
int
value
-
isNumeric
public static boolean isNumeric(char type)
DescribeisNumeric
method here.- Parameters:
type
- achar
value- Returns:
- a
boolean
value
-
-