Java OutputStream Write serialize(Object obj, OutputStream out)

Here you can find the source of serialize(Object obj, OutputStream out)

Description

Serialize to output stream

License

Open Source License

Parameter

Parameter Description
obj Object to serialize
out Where to put serialized object

Exception

Parameter Description
IOException Writing to output stream

Declaration

public static void serialize(Object obj, OutputStream out) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.ObjectOutputStream;
import java.io.OutputStream;

public class Main {
    /**/*from   ww  w . ja v  a 2 s . c  o  m*/
     * Serialize to output stream
     * 
     * @param obj
     *          Object to serialize
     * @param out
     *          Where to put serialized object
     * @throws IOException
     *           Writing to output stream
     */
    public static void serialize(Object obj, OutputStream out) throws IOException {
        ObjectOutputStream os = new ObjectOutputStream(out);
        os.writeObject(obj);
    }
}

Related

  1. copyFile(String fileName, String newFileName)
  2. copyFilePermissions(File source, File target)
  3. serialize(java.io.Serializable serializable, java.io.ObjectOutputStream oos)
  4. serialize(Object o, OutputStream out)
  5. serialize(Object obj, OutputStream out)
  6. serialize(Object object, OutputStream out)
  7. serialize(Object value, OutputStream targetOutputStream)
  8. serialize(OutputStream os, String... params)
  9. serialize(OutputStream out, Object obj)