Here you can find the source of deserialize(byte[] serializedObject)
Parameter | Description |
---|---|
serializedObject | is a serialized Object as byte-array. |
public static Object deserialize(byte[] serializedObject)
//package com.java2s; /* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 */ import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; public class Main { /**/*from www.j av a 2 s. com*/ * @param serializedObject is a serialized {@link Object} as byte-array. * @return the de-serialized {@link Object}. */ public static Object deserialize(byte[] serializedObject) { try { ByteArrayInputStream bais = new ByteArrayInputStream(serializedObject); ObjectInputStream ois = new ObjectInputStream(bais); Object result = ois.readObject(); ois.close(); return result; } catch (Exception e) { throw new RuntimeException("Failed to deserialize!", e); } } }