public class FastProto extends Object
| 构造器和说明 |
|---|
FastProto() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Encoder |
create()
Create binary block with FastProto method chain.
|
static Encoder |
create(int length)
Create fixed-length binary block with FastProto method chain.
|
static Decoder |
decode(byte[] bytes)
Convert Java object to binary data with FastProto method chain.
|
static <T> T |
decode(byte[] bytes,
Class<T> clazz)
Convert binary data to Java object with FastProto annotations.
|
static byte[] |
encode(Object object)
Convert Java object to binary data with FastProto annotations, the length of the binary data is automatically
calculated, but reverse addressing is not supported.
|
static void |
encode(Object object,
byte[] buffer)
Convert Java object to binary data with FastProto annotations, reverse addressing is supported because of fixed length.
|
static byte[] |
encode(Object object,
int length)
Convert Java object to binary data with FastProto annotations, reverse addressing is supported because of fixed length.
|
public static <T> T decode(byte[] bytes,
Class<T> clazz)
bytes - Binary data to be converted.clazz - Java object annotated with FastProto annotations.public static Decoder decode(byte[] bytes)
bytes - Binary data to be converted.public static byte[] encode(Object object)
object - Java object to be converted.public static byte[] encode(Object object, int length)
object - Java object to be converted.length - The length of the binary data.public static void encode(Object object, byte[] buffer)
object - Java object to be converted.buffer - Binary data will be written to this buffer.public static Encoder create()
public static Encoder create(int length)
length - The length of the byte arrayCopyright © 2019–2023 indunet. All rights reserved.