List of utility methods to do Is Serializable Object
boolean | isSerializable(Class c) Returns true if a class implements Serializable and false otherwise. return (Serializable.class.isAssignableFrom(c)); |
boolean | isSerializable(Class> clazz) is Serializable return Serializable.class.isAssignableFrom(clazz); |
boolean | isSerializable(Class> clazz) Checks if is serializable. while (Serializable.class.isAssignableFrom(clazz)) { clazz = clazz.getSuperclass(); if (clazz == Object.class) { return true; return false; |
boolean | isSerializable(final Object c) is Serializable return isSerializable(c.getClass());
|
boolean | isSerializable(Object o) is Serializable if (!(o instanceof Serializable)) { return false; try { new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(o); return true; } catch (NotSerializableException nse) { return false; ... |
boolean | isSerializable(Object o) is Serializable ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new ByteArrayOutputStream()); oos.writeObject(o); return true; } catch (IOException e) { return false; } finally { ... |
boolean | isSerializable(Object o) is Serializable try { testSerialization(o); return true; } catch (NotSerializableException ex) { return false; |
boolean | isSerializable(Object o) is Serializable try { serializeObject(o); } catch (IOException e) { return false; return true; |
boolean | isSerializable(Object ob) Checks if a given object is serializable. if (!(ob instanceof Serializable)) { return false; try { ob = serializeUnserialize(ob); return ob != null; } catch (Exception e) { return false; ... |
boolean | isSerializable(Object obj) This method tests if an object is serializable via the standard Java serialisation mechanism by attempting a serialisation try { _serialisation_test_stream.writeObject(obj); return true; } catch (Throwable e) { return false; |