Java Object Serialize serialize(Object obj)

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

Description

serialize

License

Apache License

Declaration

public static byte[] serialize(Object obj) 

Method Source Code

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

import java.io.*;

public class Main {
    public static byte[] serialize(Object obj) {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        ObjectOutputStream o;/*from   ww w.  j a  v a  2 s  .  com*/
        try {
            o = new ObjectOutputStream(b);
            o.writeObject(obj);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return b.toByteArray();
    }
}

Related

  1. serialize(java.io.Serializable obj)
  2. serialize(Object c, ScriptableObject scope)
  3. serialize(Object o)
  4. serialize(Object o)
  5. serialize(Object obj)
  6. serialize(Object obj)
  7. serialize(Object obj)
  8. serialize(Object obj)
  9. serialize(Object obj)