Here you can find the source of serializeCookie(Object object, String filePath)
public static void serializeCookie(Object object, String filePath)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void serializeCookie(Object object, String filePath) { OutputStream fos = null;//from w w w .ja v a2 s.co m try { fos = new FileOutputStream(filePath); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(object); oos.flush(); fos.close(); oos.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }