List of utility methods to do Class Load from File
T | deserialize(Class super T> expectedType, byte[] data) deserialize try { ObjectInputStream out = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = out.readObject(); out.close(); if (!(expectedType.isAssignableFrom(o.getClass()))) { throw new IllegalStateException("Unexpected type: " + o.getClass()); return (T) o; ... |
T | deserialize(Class deserialize ByteArrayInputStream byteIn = new ByteArrayInputStream(bytes); ObjectInputStream objectIn = new ObjectInputStream(byteIn); return (T) objectIn.readObject(); |
T | deserialize(Class deserialize ObjectInputStream ois = null; try { ois = new ObjectInputStream(new FileInputStream(file)); return (T) ois.readObject(); } finally { if (ois != null) { ois.close(); |
T | deserialize(Class deserialize ObjectInputStream objectIn = null; try { objectIn = new ObjectInputStream(in); return clazz.cast(objectIn.readObject()); } finally { if (objectIn != null) { try { objectIn.close(); ... |
T | deserialize(Class Turns a byte array into an object. checkNotNull(type); if (objectBytes == null) { return null; try { return type.cast(new ObjectInputStream(new ByteArrayInputStream(objectBytes)).readObject()); } catch (ClassNotFoundException | IOException e) { throw new IllegalArgumentException("Unable to deserialize: objectBytes=" + base16().encode(objectBytes), ... |