All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class global.Convert

java.lang.Object
   |
   +----global.Convert

public class Convert
extends Object

Constructor Index

 o Convert()

Method Index

 o getCharValue(int, byte[])
reads 2 bytes from the given byte array at the specified position convert it to a character
 o getFloValue(int, byte[])
read 4 bytes from given byte array at the specified position convert it to a float value
 o getIntValue(int, byte[])
read 4 bytes from given byte array at the specified position convert it to an integer
 o getShortValue(int, byte[])
read 2 bytes from given byte array at the specified position convert it to a short integer
 o getStrValue(int, byte[], int)
reads a string that has been encoded using a modified UTF-8 format from the given byte array at the specified position
 o setCharValue(char, int, byte[])
Update a character in the given byte array at the specified position.
 o setFloValue(float, int, byte[])
update a float value in the given byte array at the specified position
 o setIntValue(int, int, byte[])
update an integer value in the given byte array at the specified position
 o setShortValue(short, int, byte[])
update a short integer in the given byte array at the specified position
 o setStrValue(String, int, byte[])
Insert or update a string in the given byte array at the specified position.

Constructors

 o Convert
 public Convert()

Methods

 o getIntValue
 public static int getIntValue(int position,
                               byte data[]) throws IOException
read 4 bytes from given byte array at the specified position convert it to an integer

Parameters:
data - a byte array
position - in data[]
Returns:
the integer
Throws: IOException
I/O errors
 o getFloValue
 public static float getFloValue(int position,
                                 byte data[]) throws IOException
read 4 bytes from given byte array at the specified position convert it to a float value

Parameters:
data - a byte array
position - in data[]
Returns:
the float value
Throws: IOException
I/O errors
 o getShortValue
 public static short getShortValue(int position,
                                   byte data[]) throws IOException
read 2 bytes from given byte array at the specified position convert it to a short integer

Parameters:
data - a byte array
position - the position in data[]
Returns:
the short integer
Throws: IOException
I/O errors
 o getStrValue
 public static String getStrValue(int position,
                                  byte data[],
                                  int length) throws IOException
reads a string that has been encoded using a modified UTF-8 format from the given byte array at the specified position

Parameters:
data - a byte array
position - the position in data[]
length - the length of the string in bytes (=strlength +2)
Returns:
the string
Throws: IOException
I/O errors
 o getCharValue
 public static char getCharValue(int position,
                                 byte data[]) throws IOException
reads 2 bytes from the given byte array at the specified position convert it to a character

Parameters:
data - a byte array
position - the position in data[]
Returns:
the character
Throws: IOException
I/O errors
 o setIntValue
 public static void setIntValue(int value,
                                int position,
                                byte data[]) throws IOException
update an integer value in the given byte array at the specified position

Parameters:
data - a byte array
value - the value to be copied into the data[]
position - the position of tht value in data[]
Throws: IOException
I/O errors
 o setFloValue
 public static void setFloValue(float value,
                                int position,
                                byte data[]) throws IOException
update a float value in the given byte array at the specified position

Parameters:
data - a byte array
value - the value to be copied into the data[]
position - the position of tht value in data[]
Throws: IOException
I/O errors
 o setShortValue
 public static void setShortValue(short value,
                                  int position,
                                  byte data[]) throws IOException
update a short integer in the given byte array at the specified position

Parameters:
data - a byte array
value - the value to be copied into data[]
position - the position of tht value in data[]
Throws: IOException
I/O errors
 o setStrValue
 public static void setStrValue(String value,
                                int position,
                                byte data[]) throws IOException
Insert or update a string in the given byte array at the specified position.

Parameters:
data - a byte array
value - the value to be copied into data[]
position - the position of tht value in data[]
Throws: IOException
I/O errors
 o setCharValue
 public static void setCharValue(char value,
                                 int position,
                                 byte data[]) throws IOException
Update a character in the given byte array at the specified position.

Parameters:
data - a byte array
value - the value to be copied into data[]
position - the position of tht value in data[]
Throws: IOException
I/O errors

All Packages  Class Hierarchy  This Package  Previous  Next  Index