Java Byte Array to Object deserialize(byte[] bytes)

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

Description

deserialize

License

Apache License

Declaration

public static Object deserialize(byte[] bytes) 

Method Source Code

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

import java.io.*;

public class Main {
    public static Object deserialize(byte[] bytes) {
        if (bytes == null) {
            return null;
        }/*from ww w  .  jav a  2 s. c  o  m*/
        ByteArrayInputStream b = new ByteArrayInputStream(bytes);
        ObjectInputStream o;
        try {
            o = new ObjectInputStream(b);
            return o.readObject();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. deserialize(byte[] bytes)
  2. deserialize(byte[] bytes)
  3. deserialize(byte[] bytes)
  4. deserialize(byte[] bytes)
  5. deserialize(byte[] bytes)
  6. deserialize(byte[] bytes)
  7. deserialize(byte[] bytes)
  8. deserialize(byte[] bytes)
  9. deserialize(byte[] bytes)