public class SerializationUtils extends Object
Constructor and Description |
---|
SerializationUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
deserialize(byte[] bytes)
反序列化
|
static void |
init(String ser,
Properties props)
初始化序列化器
|
static byte[] |
serialize(Object obj)
针对不同类型做单独处理
|
static byte[] |
serializeWithoutException(Object obj) |
public static void init(String ser, Properties props)
ser
- serialization methodprops
- serializer propertiespublic static byte[] serialize(Object obj) throws IOException
obj
- 待序列化的对象IOException
- io exceptionpublic static byte[] serializeWithoutException(Object obj)
public static Object deserialize(byte[] bytes) throws IOException
bytes
- 待反序列化的字节数组IOException
- io exceptionCopyright © 2018. All rights reserved.