public final class BizarroIntegers
extends java.lang.Object
Integers. Not compatible with the RLP specification.
Negative integers are stored in a minimal big-endian two's complement representation. Non-negative integers are
stored full-length. Negative one is represented by the empty byte array. Numbers are sign-extended on decode.
-256L => 0x00
-16L => 0xf0
-1L => 0x
0L => 0x0000000000000000
1L => 0x0000000000000001
16L => 0x0000000000000010| 构造器和说明 |
|---|
BizarroIntegers() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
bitLen(long val)
NOTE: will always return
Long.SIZE for non-negative integers. |
static byte |
getByte(byte[] buffer,
int index,
int len) |
static int |
getInt(byte[] buffer,
int index,
int len) |
static long |
getLong(byte[] buffer,
int index,
int len) |
static short |
getShort(byte[] buffer,
int index,
int len) |
static int |
len(byte val) |
static int |
len(int val) |
static int |
len(long val) |
static int |
len(short val) |
static int |
putByte(byte val,
byte[] o,
int i) |
static int |
putInt(int val,
byte[] o,
int i) |
static int |
putLong(long val,
byte[] o,
int i) |
static int |
putLong(long val,
java.nio.ByteBuffer o) |
static int |
putShort(short val,
byte[] o,
int i) |
static byte[] |
toBytes(byte val) |
static byte[] |
toBytes(int val) |
static byte[] |
toBytes(long val) |
static byte[] |
toBytes(short val) |
public static byte[] toBytes(byte val)
public static byte[] toBytes(short val)
public static byte[] toBytes(int val)
public static byte[] toBytes(long val)
public static int putByte(byte val,
byte[] o,
int i)
public static int putShort(short val,
byte[] o,
int i)
public static int putInt(int val,
byte[] o,
int i)
public static int putLong(long val,
byte[] o,
int i)
public static int putLong(long val,
java.nio.ByteBuffer o)
public static byte getByte(byte[] buffer,
int index,
int len)
public static short getShort(byte[] buffer,
int index,
int len)
public static int getInt(byte[] buffer,
int index,
int len)
public static long getLong(byte[] buffer,
int index,
int len)
public static int len(byte val)
public static int len(short val)
public static int len(int val)
public static int len(long val)
public static int bitLen(long val)
Long.SIZE for non-negative integers. See also Integers#bitLen(long).val - the long value