public final class Framing extends Object
PUBLIC-LINEAGE-ID-V1 (identity-v1.md, Section 3.1): one type byte and a
payload per value.
| Byte | Java value | Payload |
|---|---|---|
0x00 | null | none |
0x01 | String | 8-byte length, strict UTF-8 |
0x02 | Long, Integer, Short, Byte, BigInteger |
8 bytes, signed big-endian |
0x03 | List | 8-byte count, then each element |
0x04 | Boolean | 1 byte |
0x05 | Code | as a string |
| Modifier and Type | Field and Description |
|---|---|
static int |
T_BOOLEAN |
static int |
T_CODE |
static int |
T_INTEGER |
static int |
T_LIST |
static int |
T_NULL |
static int |
T_STRING |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
frame(Object value)
The framed bytes of one value.
|
static void |
frameInto(Object value,
ByteArrayOutputStream out)
frame(value) appended to out; lists are walked with an explicit stack. |
static String |
hex(byte[] data)
Lowercase hexadecimal of bytes.
|
static byte[] |
utf8(String text)
Strict UTF-8 of a string (
identity-v1.md, Section 3.2): no normalization. |
public static final int T_NULL
public static final int T_STRING
public static final int T_INTEGER
public static final int T_LIST
public static final int T_BOOLEAN
public static final int T_CODE
public static byte[] frame(Object value)
SqllrException - ID_INVALID_UNICODE for a string that is not a sequence of Unicode scalar
values, ID_INTEGER_OUT_OF_RANGE for an integer outside 64-bit signed,
ID_INVALID_INPUT for any other Java typepublic static void frameInto(Object value, ByteArrayOutputStream out)
frame(value) appended to out; lists are walked with an explicit stack.public static byte[] utf8(String text)
identity-v1.md, Section 3.2): no normalization.SqllrException - ID_INVALID_UNICODE for an unpaired surrogate