Java Object Deserialize deserializeObject(byte[] bytes)

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

Description

deserialize Object

License

Open Source License

Declaration

protected static <T> T deserializeObject(byte[] bytes) 

Method Source Code


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

import java.io.*;

public class Main {
    protected static <T> T deserializeObject(byte[] bytes) {
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
        try {/*w ww.  j  av a 2  s. c o m*/
            ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
            return (T) objectInputStream.readObject();

        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        throw new RuntimeException();
    }
}

Related

  1. deserializeObject(byte[] buf)
  2. deserializeObject(byte[] bytes)
  3. deserializeObject(byte[] bytes)
  4. deserializeObject(byte[] bytes)
  5. deserializeObject(byte[] bytes)
  6. deserializeObject(byte[] data)
  7. deserializeObject(byte[] data)
  8. deSerializeObject(byte[] data)
  9. deserializeObject(byte[] data, Class clazz)