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 voidcopyArrays(byte[] dest, byte[] source, int fromIdx)DescribecopyArraysmethod here.static ObjectdecodeData(byte[] bytes, char type)DescribedecodeDatamethod here.static doubledecodeDouble(byte[] bytes)DescribedecodeDoublemethod here.static floatdecodeFloat(byte[] bytes)DescribedecodeFloatmethod here.static intdecodeInt(byte[] bytes)DescribedecodeIntmethod here.static shortdecodeShort(byte[] bytes)DescribedecodeShortmethod here.static intgetDataTypeSize(char type)DescribegetDataTypeSizemethod here.static booleanisNumeric(char type)DescribeisNumericmethod here.static intlittleEndianToInt(byte[] fourBytes)static byte[]toBigEndian(byte[] source)Converts the provided array to big endian.static intunsigByteToInt(byte b)DescribeunsigByteToIntmethod 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)
DescribedecodeDatamethod here.- Parameters:
bytes- abyte[]valuetype- acharvalue- Returns:
- an
Objectvalue
-
copyArrays
public static void copyArrays(byte[] dest, byte[] source, int fromIdx)DescribecopyArraysmethod here.- Parameters:
dest- abyte[]valuesource- abyte[]valuefromIdx- anintvalue
-
decodeShort
public static short decodeShort(byte[] bytes)
DescribedecodeShortmethod here.- Parameters:
bytes- abyte[]value- Returns:
- a
shortvalue
-
littleEndianToInt
public static int littleEndianToInt(byte[] fourBytes)
-
decodeInt
public static int decodeInt(byte[] bytes)
DescribedecodeIntmethod here.- Parameters:
bytes- abyte[]value- Returns:
- an
intvalue
-
decodeFloat
public static float decodeFloat(byte[] bytes)
DescribedecodeFloatmethod here.- Parameters:
bytes- abyte[]value- Returns:
- a
floatvalue
-
decodeDouble
public static double decodeDouble(byte[] bytes)
DescribedecodeDoublemethod here.- Parameters:
bytes- abyte[]value- Returns:
- a
doublevalue
-
unsigByteToInt
public static int unsigByteToInt(byte b)
DescribeunsigByteToIntmethod here.- Parameters:
b- abytevalue- Returns:
- an
intvalue
-
getDataTypeSize
public static int getDataTypeSize(char type)
DescribegetDataTypeSizemethod here.- Parameters:
type- acharvalue- Returns:
- an
intvalue
-
isNumeric
public static boolean isNumeric(char type)
DescribeisNumericmethod here.- Parameters:
type- acharvalue- Returns:
- a
booleanvalue
-
-