Android Byte Array to Object Convert byteToObject(byte[] bytes)

Here you can find the source of byteToObject(byte[] bytes)

Description

byte To Object

Declaration

public static Object byteToObject(byte[] bytes) throws Exception 

Method Source Code

//package com.java2s;
import java.io.ByteArrayInputStream;

import java.io.ObjectInputStream;

public class Main {

    public static Object byteToObject(byte[] bytes) throws Exception {
        ObjectInputStream ois = null;
        try {//ww w  .j  a  v  a2  s  . co  m
            ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
            return ois.readObject();
        } finally {
            if (ois != null)
                ois.close();
        }
    }
}

Related

  1. ByteToObject(byte[] bytes)
  2. getObject(byte[] bytes)