List of utility methods to do InputStream Deserialize to Object
T | deserialize(String input, Class Returns JSON encoded string as real object return OBJECT_MAPPER.readValue(input, tClass);
|
Object | deserializeFromStram(InputStream inputStram) deserialize From Stram ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(inputStram)); Object ret = in.readObject(); in.close(); return ret; |
T | deserializeFromStream(ObjectInputStream in) deserialize From Stream try { @SuppressWarnings("unchecked") T obj = (T) in.readObject(); return obj; } catch (ClassNotFoundException e) { throw new IOException("Deserialization error", e); |
Integer | deserializeInt(InputStream in) deserialize Int try { int ch1 = in.read(); int ch2 = in.read(); int ch3 = in.read(); int ch4 = in.read(); int i = ((ch1 & 0xFF) << 24) | ((ch2 & 0xFF) << 16) | ((ch3 & 0xFF) << 8) | (ch4 & 0xFF); return new Integer(i); } catch (IOException ex) { ... |
T | deserializeSpecial(InputStream is, Class Like deserialize but leaves the supplied stream open. Object obj = ""; try { ObjectInputStream ois = new ObjectInputStream(is); obj = ois.readObject(); return clazz.cast(obj); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (ClassCastException e) { ... |
UUID | deserializeUUID(InputStream in) deserialize UUID byte[] data = new byte[16]; try { in.read(data); } catch (IOException e) { e.printStackTrace(); long msb = 0; long lsb = 0; ... |