List of utility methods to do Byte Array to Object Convert
Object | ByteToObject(byte[] bytes) Byte To Object Object obj = null; try { ByteArrayInputStream bi = new ByteArrayInputStream(bytes); ObjectInputStream oi = new ObjectInputStream(bi); obj = oi.readObject(); bi.close(); oi.close(); } catch (Exception e) { ... |
Object | byteToObject(byte[] bytes) byte To Object ObjectInputStream ois = null; try { ois = new ObjectInputStream(new ByteArrayInputStream(bytes)); return ois.readObject(); } finally { if (ois != null) ois.close(); |
Object | getObject(byte[] bytes) get Object ByteArrayInputStream bi = new ByteArrayInputStream(bytes); ObjectInputStream oi = new ObjectInputStream(bi); Object obj = oi.readObject(); bi.close(); oi.close(); return obj; |