Here you can find the source of serializeObject(String absFilePath, Object obj)
public static void serializeObject(String absFilePath, Object obj) throws Exception
//package com.java2s; //License from project: Apache License import java.io.FileOutputStream; import java.io.ObjectOutputStream; public class Main { public static void serializeObject(String absFilePath, Object obj) throws Exception { FileOutputStream fileStream = null; ObjectOutputStream objStream = null; try {//from www. j a va 2 s. c o m fileStream = new FileOutputStream(absFilePath); objStream = new ObjectOutputStream(fileStream); objStream.writeObject(obj); } finally { if (objStream != null) objStream.close(); if (fileStream != null) fileStream.close(); } } }