Java Serialize serializeObject(String absFilePath, Object obj)

Here you can find the source of serializeObject(String absFilePath, Object obj)

Description

serialize Object

License

Apache License

Declaration

public static void serializeObject(String absFilePath, Object obj) throws Exception 

Method Source Code

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

Related

  1. serializeIntLE(int value, byte[] outbuf, int offset)
  2. serializeJdk(Object obj)
  3. serializeMock(Object mock)
  4. serializeObject(B b)
  5. serializeObject(final Object object)
  6. serializeObject(String path, Object e)
  7. serializeObject(T obj)
  8. serializeObjects(File oof, Object[] objectsOut)
  9. serializeObjectToFile(Object obj, File f)