|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.ipc.bon.ValueTrafo
public final class ValueTrafo
Helper class to convert between byte arrays and scalar values.
| Method Summary | |
|---|---|
static double |
byte2double(byte[] b)
Reads 8 byte from the byte array and converts them to a double value. |
static int |
byte2int(byte[] b)
Converts given byte array to positive int value assuming result < 2^31. |
static long |
byte2long(byte[] b)
Converts given byte array to positive long value. |
static java.lang.String |
byte2string(byte[] b)
Converts the given byte array to a string by using the default encoding. |
static byte[] |
double2byte(double d)
Converts the given double value to a byte array. |
static int |
getBytesLength(long v)
Get minimum number of bytes to store the long value. |
static byte[] |
long2byte(long v)
Converts positive long value to byte array in Big Endian byte order. |
static byte[] |
long2byte(long v,
int byteLength)
Converts positive long value to byte array in Big Endian byte order, assuming the length of the resulting byte array has been calculated before. |
static byte[] |
string2byte(java.lang.String s)
Converts the given string to a byte array using the default encoding (utf-8). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static long byte2long(byte[] b)
b - the byte array with length <= 8
public static int byte2int(byte[] b)
b - the byte array with length <= 4
public static byte[] long2byte(long v,
int byteLength)
v - long value.byteLength - length of resulting byte array
public static byte[] long2byte(long v)
v - long value.
public static int getBytesLength(long v)
v - long value.
public static double byte2double(byte[] b)
b - byte array
public static java.lang.String byte2string(byte[] b)
b - byte array.
public static byte[] double2byte(double d)
d - double value.
public static byte[] string2byte(java.lang.String s)
s - string value.
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||