public class TSerialize extends Object
Constructor and Description |
---|
TSerialize() |
Modifier and Type | Method and Description |
---|---|
protected static Class |
getClassByHash(Integer hashcode) |
protected static Integer |
getHashByClass(Class clazz) |
static int |
register(Class clazz)
注册一个 Class 名称简写
|
static void |
register(Integer code,
Class clazz)
注册一个 Class 名称简写
|
static byte[] |
serialize(Object object)
序列化对象
|
static Object |
unserialize(byte[] bytes)
反序列化对象
|
public static Serialize SERIALIZE
public static byte[] serialize(Object object)
object
- 待序列化的对象public static Object unserialize(byte[] bytes)
bytes
- 序列化后的字节public static int register(Class clazz)
clazz
- 类对象public static void register(Integer code, Class clazz)
code
- 简写代码clazz
- 类对象protected static Class getClassByHash(Integer hashcode) throws ClassNotFoundException
ClassNotFoundException
Copyright © 2020 Voovan. All rights reserved.