Java Object Serialize serialize(Object obj)

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

Description

serialize

License

Open Source License

Declaration

public static byte[] serialize(Object obj) throws IOException 

Method Source Code


//package com.java2s;

import java.io.ByteArrayOutputStream;

import java.io.IOException;

import java.io.ObjectOutputStream;

public class Main {
    public static byte[] serialize(Object obj) throws IOException {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        ObjectOutputStream o = new ObjectOutputStream(b);
        o.writeObject(obj);//from www. java 2  s.c om
        return b.toByteArray();
    }
}

Related

  1. serialize(Object obj)
  2. serialize(Object obj)
  3. serialize(Object obj)
  4. serialize(Object obj)
  5. serialize(Object obj)
  6. serialize(Object obj)
  7. serialize(Object obj)
  8. serialize(Object obj)
  9. serialize(Object obj)