Here you can find the source of deserialize(byte[] serializedData, int startPos, int length)
Parameter | Description |
---|---|
serializedData | a parameter |
startPos | a parameter |
length | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static Object deserialize(byte[] serializedData, int startPos, int length) throws IOException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { /**/*from w w w . j a v a2s .c o m*/ * Deserialize object from given byte array, starting at startPos and using length bytes. * * @param serializedData * @param startPos * @param length * @return * @throws IOException */ public static Object deserialize(byte[] serializedData, int startPos, int length) throws IOException { try (ObjectInputStream ois = new ObjectInputStream( new ByteArrayInputStream(serializedData, startPos, length))) { return ois.readObject(); } catch (ClassNotFoundException e) { throw new IllegalStateException("Unmarshalling exception", e); } } }