Here you can find the source of serializeDeserialize(final Serializable object)
public static void serializeDeserialize(final Serializable object) throws IOException, ClassNotFoundException
//package com.java2s; //License from project: LGPL import java.io.*; public class Main { public static void serializeDeserialize(final Serializable object) throws IOException, ClassNotFoundException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(1000); ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(object); objectOutputStream.close();/*from www .j av a 2 s .c om*/ ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream); Object deserialized = objectInputStream.readObject(); objectInputStream.close(); } }