SerializationUtil

public class SerializationUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SerializationUtil


Utility to serialize/deserialize an object that implements Serializable.

Summary

Public constructors

SerializationUtil()

Public methods

static Object deserialize(File serializedFile, boolean deleteFile)

Deserialize an object that was serialized using serialize(Serializable).

static File serialize(Serializable o)

Serialize a object that implements Serializable.

Public constructors

SerializationUtil

public SerializationUtil ()

Public methods

deserialize

public static Object deserialize (File serializedFile, 
                boolean deleteFile)

Deserialize an object that was serialized using serialize(Serializable).

Parameters
serializedFile File: the file where the object was serialized.

deleteFile boolean: true if the serialized file should be deleted once deserialized.

Returns
Object the Object deserialized.

Throws
IOException if the deserialization fails.

serialize

public static File serialize (Serializable o)

Serialize a object that implements Serializable.

Parameters
o Serializable: the object to serialize.

Returns
File the File where the object was serialized.

Throws
IOException if serialization fails.