List of utility methods to do Object Deserialize
Object | deserialize(byte[] objectData) deserialize if (objectData == null) { throw new IllegalArgumentException("The byte[] must not be null"); ByteArrayInputStream bais = new ByteArrayInputStream(objectData); ObjectInputStream in = null; try { in = new ObjectInputStream(bais); return in.readObject(); ... |
Object | deserialize(byte[] objectData) Deserializes a single if (objectData == null) throw new IllegalArgumentException("The byte[] must not be null"); ByteArrayInputStream bais = new ByteArrayInputStream(objectData); return deserialize(bais); |
Object | deserialize(byte[] objectData) deserialize ByteArrayInputStream buffer = new ByteArrayInputStream(objectData); try (ObjectInputStream in = new ObjectInputStream(buffer)) { return in.readObject(); } catch (ClassNotFoundException e) { throw new IllegalStateException("Unable to deserialize", e); |
Object | deserialize(byte[] serial) Deserialized an array of bytes into a Serializable object. ByteArrayInputStream bais = new ByteArrayInputStream(serial); ObjectInputStream ois = new ObjectInputStream(bais); try { return ois.readObject(); } finally { if (ois != null) { ois.close(); if (bais != null) { bais.close(); |
Object | deserialize(byte[] serial) Redintegrate a serialized object. ByteArrayInputStream bais = new ByteArrayInputStream(serial); ObjectInputStream ois = null; try { ois = new ObjectInputStream(bais); return ois.readObject(); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { ... |
Object | deserialize(byte[] serialized) deserialize try { ByteArrayInputStream bis = new ByteArrayInputStream(serialized); ObjectInputStream ois = new ObjectInputStream(bis); Object ret = ois.readObject(); ois.close(); return ret; } catch (IOException ioe) { throw new RuntimeException(ioe); ... |
Object | deserialize(byte[] serializedData) Deserializes the given serialization data and returns the object. ByteArrayInputStream byteStream = new ByteArrayInputStream(serializedData); ObjectInputStream ois; Object retObject; try { ois = new ObjectInputStream(byteStream); retObject = ois.readObject(); ois.close(); } catch (Exception e) { ... |
Object | deserialize(byte[] serializedData, int startPos, int length) Deserialize object from given byte array, starting at startPos and using length bytes. try (ObjectInputStream ois = new ObjectInputStream( new ByteArrayInputStream(serializedData, startPos, length))) { return ois.readObject(); } catch (ClassNotFoundException e) { throw new IllegalStateException("Unmarshalling exception", e); |
Object | deserialize(byte[] serializedObject) deserialize 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); ... |
Serializable | deserialize(byte[] sf) Returns the object with the specified serialized form. try { InputStream is = new ByteArrayInputStream(sf); ObjectInputStream ois = new ObjectInputStream(is); return (Serializable) ois.readObject(); } catch (Exception e) { throw new IllegalArgumentException(e); |