|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.basex.util.Num
public final class Num
This class provides operations to compress and decompress integer values in byte arrays to save memory.
| Method Summary | |
|---|---|
static byte[] |
add(byte[] array,
int val)
Compresses and writes an integer value to the specified array and returns the array. |
static byte[] |
create(int[] vals)
Creates and returns a compressed array from the specified integer array. |
static byte[] |
create(int[] vals,
int vs)
Creates and returns a compressed array from the specified integer array. |
static int |
len(byte[] array,
int val)
Returns integer length. |
static byte[] |
newNum(int val)
Creates a new number array. |
static int |
read(byte[] array,
int pos)
Reads and decompresses an integer value from the specified byte array. |
static byte[] |
simpleNum(int val)
Creates a new number array. |
static int |
size(byte[] array)
Returns the length of the specified array, stored in the first four bytes. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] newNum(int val)
val - initial value to be stored
public static byte[] simpleNum(int val)
val - initial value to be stored
public static byte[] add(byte[] array,
int val)
array - arrayval - value to be written
public static byte[] create(int[] vals)
vals - values to be written
public static byte[] create(int[] vals,
int vs)
vals - values to be writtenvs - number of entries in vals
public static int read(byte[] array,
int pos)
array - arraypos - position to parse
public static int size(byte[] array)
array - array to be evaluated
public static int len(byte[] array,
int val)
array - arrayval - integer value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||