Java Object Deserialize deserialize(byte[] in)

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

Description

deserialize

License

Open Source License

Declaration

public static Object deserialize(byte[] in) 

Method Source Code

//package com.java2s;
/**//ww w.j  a v a2 s  .co  m
 * (C) 2007-2010 Taobao Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

import java.io.ByteArrayInputStream;

import java.io.ObjectInputStream;

public class Main {
    public static Object deserialize(byte[] in) {
        Object rv = null;

        try {
            if (in != null) {
                ByteArrayInputStream bis = new ByteArrayInputStream(in);
                ObjectInputStream is = new ObjectInputStream(bis);

                rv = is.readObject();
                is.close();
                bis.close();
            }
        } catch (Exception e) {
            throw new RuntimeException("deserialize failed", e);
        }

        return rv;
    }
}

Related

  1. deserialize(byte[] data)
  2. deserialize(byte[] data)
  3. deserialize(byte[] data)
  4. deserialize(byte[] features)
  5. deserialize(byte[] in)
  6. Deserialize(byte[] objectBytes)
  7. deserialize(byte[] objectData)
  8. deserialize(byte[] objectData)
  9. deserialize(byte[] objectData)