/** * Try to write value supposing that it implements self-streamable interfaces. * Return false if it does not or true on success. */ static boolean writeSelf(OutputStream output, Serializable value) { // User defined write method is present. if (value instanceof CustomMarshal) { ((CustomMarshal) value).marshal((DataOutputStream) output); return true; } else if (value instanceof Streamable) { ((Streamable) value)._write(output); return true; } return false; }
/** * Marshal method has to be implemented by the Customized Marshal class. * This is the method invoked for Marshalling. * * @param os a DataOutputStream */ void marshal(DataOutputStream os);