public class FastProto extends Object
| 构造器和说明 |
|---|
FastProto() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Encoder |
create()
Generates a binary block using the FastProto method chain.
|
static Encoder |
create(int length)
Creates a binary block of a fixed length using the FastProto method chain.
|
static Decoder |
decode(byte[] bytes)
Converts a Java object into binary data using the FastProto method chain.
|
static <T> T |
decode(byte[] bytes,
Class<T> clazz)
Converts binary data into a Java object with FastProto annotations.
|
static byte[] |
encode(Object object)
Converts a Java object into binary data using FastProto annotations.
|
static void |
encode(Object object,
byte[] buffer)
Converts a Java object into binary data using FastProto annotations.
|
static byte[] |
encode(Object object,
int length)
Transforms a Java object into binary data using FastProto annotations.
|
public static <T> T decode(byte[] bytes,
Class<T> clazz)
T - The type of the Java object that the binary data will be converted into.bytes - The binary data to be converted.clazz - The class of the Java object, annotated with FastProto annotations.public static Decoder decode(byte[] bytes)
bytes - The binary data that will be converted.public static byte[] encode(Object object)
object - The Java object to be converted, which should be annotated with FastProto annotations.public static byte[] encode(Object object, int length)
object - The Java object to be converted. It should be annotated with FastProto annotations.length - The predetermined length of the resulting binary data.public static void encode(Object object, byte[] buffer)
object - The Java object to be converted. It should be annotated with FastProto annotations.buffer - The buffer where the resulting binary data will be written.public static Encoder create()
public static Encoder create(int length)
length - The predetermined length of the binary block.Copyright © 2019–2025 indunet. All rights reserved.