|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.util.CompactInt
IOUtil
class instead.
public class CompactInt
The CompactInt
utility class provides algorithms for compact
serialization of integer numbers. It uses encoding scheme with variable-length
two's complement big-endian format capable to encode 64-bits signed numbers.
The following table defines used serial format (the first byte is given in bits with 'x' representing payload bit; the remaining bytes are given in bit count):
0xxxxxxx - for -64 <= N < 64 10xxxxxx 8x - for -8192 <= N < 8192 110xxxxx 16x - for -1048576 <= N < 1048576 1110xxxx 24x - for -134217728 <= N < 134217728 11110xxx 32x - for -17179869184 <= N < 17179869184 (includes whole range of signed int) 111110xx 40x - for -2199023255552 <= N < 2199023255552 1111110x 48x - for -281474976710656 <= N < 281474976710656 11111110 56x - for -36028797018963968 <= N < 36028797018963968 11111111 64x - for -9223372036854775808 <= N < 9223372036854775808 (the range of signed long)
Note: this class is deprecated and is replaced by IOUtil
class.
See IOUtil
class, section CompactInt, and individual methods for documentation.
Method Summary | |
---|---|
static int |
getIntLength(int n)
Deprecated. Use IOUtil.getCompactLength(long) method instead. |
static int |
readInt(java.io.DataInput in)
Deprecated. Use IOUtil.readCompactInt(java.io.DataInput) method instead. |
static long |
readLong(java.io.DataInput in)
Deprecated. Use IOUtil.readCompactLong(java.io.DataInput) method instead. |
static void |
writeInt(java.io.DataOutput out,
int n)
Deprecated. Use IOUtil.writeCompactInt(java.io.DataOutput, int) method instead. |
static void |
writeLong(java.io.DataOutput out,
long l)
Deprecated. Use IOUtil.writeCompactLong(java.io.DataOutput, long) method instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getIntLength(int n)
IOUtil.getCompactLength(long)
method instead.
public static void writeInt(java.io.DataOutput out, int n) throws java.io.IOException
IOUtil.writeCompactInt(java.io.DataOutput, int)
method instead.
java.io.IOException
public static int readInt(java.io.DataInput in) throws java.io.IOException
IOUtil.readCompactInt(java.io.DataInput)
method instead.
int
data type,
then loss of precision occurs as it is type casted into
int
; the number is read entirely in this case.
java.io.IOException
public static void writeLong(java.io.DataOutput out, long l) throws java.io.IOException
IOUtil.writeCompactLong(java.io.DataOutput, long)
method instead.
java.io.IOException
public static long readLong(java.io.DataInput in) throws java.io.IOException
IOUtil.readCompactLong(java.io.DataInput)
method instead.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |