public class FastProto extends Object
| 构造器和说明 |
|---|
FastProto() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Encoder |
create()
Helps developers create binary data through chain api.
|
static Encoder |
create(int length)
Helps developers create binary data through chain api.
|
static Decoder |
parse(byte[] bytes)
Helps developers parse binary data through chain api.
|
static <T> T |
parse(@NonNull byte[] bytes,
@NonNull Class<T> clazz)
Convert byte array into object.
|
static byte[] |
toBytes(Object object)
Convert object into byte array.
|
static void |
toBytes(Object object,
byte[] buffer)
Convert object into byte array.
|
static byte[] |
toBytes(Object object,
int length)
Convert object into byte array.
|
public static <T> T parse(@NonNull
@NonNull byte[] bytes,
@NonNull
@NonNull Class<T> clazz)
bytes - byte arrayclazz - class of deserialized objectpublic static Decoder parse(byte[] bytes)
bytes - binary data need parsingpublic static byte[] toBytes(Object object)
object - serialized objectpublic static byte[] toBytes(Object object, int length)
object - serialized objectlength - the length of byte arraypublic static void toBytes(Object object, byte[] buffer)
object - serialized objectbuffer - write result into bufferpublic static Encoder create()
public static Encoder create(int length)
length - the length of the byte arrayCopyright © 2019–2023 indunet. All rights reserved.