Java Serialize serializeToFile(Object obj, String fileName)

Here you can find the source of serializeToFile(Object obj, String fileName)

Description

serialize To File

License

Apache License

Declaration

public static void serializeToFile(Object obj, String fileName) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedOutputStream;

import java.io.FileOutputStream;
import java.io.IOException;

import java.io.ObjectOutputStream;

public class Main {
    public static void serializeToFile(Object obj, String fileName) throws IOException {
        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));
        out.writeObject(obj);//from  www.  j  av a2  s  .com
        out.close();
    }
}

Related

  1. serializer(Object object)
  2. serializeSafe(T obj)
  3. serializeShort(short value, byte[] outbuf, int offset)
  4. serializeString(File file, String string)
  5. serializeToBase64(Serializable object)
  6. serializeToFile(Object object, File file)
  7. serializeToFile(Serializable s, String path)
  8. serializeToString(Object o)
  9. serializeToSurefireDirectory(final Class testClass, final Object object)