@Deprecated public final class SerializedObjectExtensions extends Object
Constructor and Description |
---|
SerializedObjectExtensions()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Object |
readSerializedObjectFromFile(File file)
Deprecated.
Reads the object from the given file.
|
static <T> byte[] |
toByteArray(T object)
Deprecated.
The Method toByteArray() serialize an Object to byte array.
|
static Object |
toObject(byte[] byteArray)
Deprecated.
The Method toObject() converts the given byte array into an Object.
|
static boolean |
writeSerializedObjectToFile(Object obj,
File file)
Deprecated.
Writes the given object to the given File.
|
public static Object readSerializedObjectFromFile(File file) throws IOException, ClassNotFoundException
file
- In that file is the object saved.IOException
- Signals that an I/O exception has occurred.ClassNotFoundException
- is thrown when a class is not found in the classloader or no definition for the
class with the specified name could be found.public static <T> byte[] toByteArray(T object) throws IOException
T
- the generic type of the given objectobject
- The Object to convert into a byte array.IOException
- Signals that an I/O exception has occurred.public static Object toObject(byte[] byteArray) throws IOException, ClassNotFoundException
byteArray
- The byte array to convert into an Object.IOException
- Signals that an I/O exception has occurred.ClassNotFoundException
- is thrown when a class is not found in the classloader or no definition for the
class with the specified name could be found.public static boolean writeSerializedObjectToFile(Object obj, File file) throws IOException
obj
- The object to write to the File.file
- In this file will be the object saved.IOException
- Signals that an I/O exception has occurred.Copyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.