Java InputStream Deserialize to Object deserialize(InputStream is)

Here you can find the source of deserialize(InputStream is)

Description

deserialize

License

Open Source License

Declaration

public static <T extends Serializable> T deserialize(InputStream is)
            throws IOException, ClassNotFoundException 

Method Source Code

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

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

import java.io.Serializable;

public class Main {
    public static <T extends Serializable> T deserialize(InputStream is)
            throws IOException, ClassNotFoundException {
        ObjectInputStream in = new ObjectInputStream(is);
        @SuppressWarnings("unchecked")
        T e = (T) in.readObject();//from w  w  w .j ava2 s  .c  o m
        in.close();
        return e;
    }
}

Related

  1. deserialize(InputStream in, Class cls)
  2. deserialize(InputStream inputStream)
  3. deserialize(InputStream inputStream)
  4. deserialize(InputStream inputStream)
  5. deserialize(InputStream is)
  6. deserialize(InputStream sourceInputStream, Class objectType)
  7. deserialize(ObjectInputStream stream)
  8. deserialize(String input, Class tClass)
  9. deserializeFromStram(InputStream inputStram)