|
||||||||||
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 int |
len(byte[] array,
int val)
Returns integer length. |
static int |
len(int v)
Returns the compressed length of the specified value. |
static byte[] |
newNum(int val)
Creates a new number array. |
static byte[] |
num(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 int |
size(byte[] array)
Returns the length of the specified array, stored in the first four bytes. |
static void |
size(byte[] array,
int len)
Writes the specified length in the first bytes of the specified array. |
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[] num(int val)
val
- initial value to be stored
public static byte[] add(byte[] array, int val)
array
- arrayval
- value to be written
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
public static void size(byte[] array, int len)
array
- arraylen
- new lengthpublic static int len(int v)
v
- integer value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |