Java Object Serialize and Deserialize deserializeObjectFromByteArray(byte[] data)

Here you can find the source of deserializeObjectFromByteArray(byte[] data)

Description

Read the object from Base64 string.

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
public static <T> T deserializeObjectFromByteArray(byte[] data)
        throws IOException, ClassNotFoundException 

Method Source Code

//package com.java2s;

import java.io.ByteArrayInputStream;

import java.io.IOException;
import java.io.ObjectInputStream;

public class Main {
    /** Read the object from Base64 string. */
    @SuppressWarnings("unchecked")
    public static <T> T deserializeObjectFromByteArray(byte[] data)
            throws IOException, ClassNotFoundException {
        if (data == null)
            return null;
        ObjectInputStream ois = new ObjectInputStream(
                new ByteArrayInputStream(data));
        Object o = ois.readObject();
        ois.close();//from   w  ww .java 2 s  . c  o m
        return (T) o;
    }
}

Related

  1. deserializeJdk(byte[] bytes)
  2. deSerializeObj(byte[] array)
  3. deSerializeObject(byte[] base64SerializedObject)
  4. deserializeObject(String dir)
  5. deSerializeObject(String str, Class cls)
  6. deserializeObjectFromByteArray(byte[] theSerializedVersion)
  7. deserializeProperties(byte[] bytes)
  8. deserializeRaw(byte[] array)
  9. deserializeSafe(byte[] buf, T obj)