public class SerializationUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
SerializationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserialize(byte[] bytes)
Deserializes object from byte array
|
static <T> T |
deserialize(java.io.InputStream is)
Deserializes object from InputStream
|
static <T> T |
fromByteArray(byte[] bytes)
Deserializes object from byte array
|
static <T> T |
readObject(java.io.File file) |
static <T> T |
readObject(java.io.InputStream is)
Reads an object from the given input stream
|
static void |
saveObject(java.lang.Object toSave,
java.io.File saveTo) |
static void |
serialize(java.io.Serializable object,
java.io.OutputStream os)
Writes the object to the output stream
THIS DOES NOT FLUSH THE STREAM
|
static byte[] |
toByteArray(java.io.Serializable toSave)
Converts the given object to a byte array
|
static void |
writeObject(java.io.Serializable toSave,
java.io.OutputStream writeTo)
Writes the object to the output stream
THIS DOES NOT FLUSH THE STREAM
|
public static <T> T readObject(java.io.File file)
public static <T> T readObject(java.io.InputStream is)
is - the input stream to read frompublic static byte[] toByteArray(java.io.Serializable toSave)
toSave - the object to savepublic static <T> T fromByteArray(byte[] bytes)
T - bytes - public static <T> T deserialize(byte[] bytes)
T - bytes - public static <T> T deserialize(java.io.InputStream is)
T - bytes - public static void writeObject(java.io.Serializable toSave,
java.io.OutputStream writeTo)
toSave - the object to savewriteTo - the output stream to write topublic static void serialize(java.io.Serializable object,
java.io.OutputStream os)
toSave - the object to savewriteTo - the output stream to write topublic static void saveObject(java.lang.Object toSave,
java.io.File saveTo)
Copyright © 2019. All rights reserved.