Java Serialize serializeCookie(Object object, String filePath)

Here you can find the source of serializeCookie(Object object, String filePath)

Description

serialize Cookie

License

Open Source License

Declaration

public static void serializeCookie(Object object, String filePath) 

Method Source Code


//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();
        }
    }
}

Related

  1. serializeClone(final Object obj)
  2. serializedCopy(Object obj)
  3. serializedCopy(T object)
  4. serializeDistributionType(String distributionType, String HadoopDistribution)
  5. serializeExecutor(Object executor)