/** * Writes the given DataObject to an output stream. * * @throws IOException if an I/O error occurs. */ public void write(DataCompound o, DataOutStream out) throws IOException { o.writeData(out); }
/** * Creates a new compound in read/write mode. * * @param writeMode true for write mode, false for read mode. */ public DataCompound newCompound(boolean writeMode) { DataCompound c = newCompound(); if (writeMode) c.setWriteMode(); else c.setReadMode(); return c; }
/** * Reads a DataObject from the given input stream and returns it. * * @throws IOException if an I/O error occurs. */ public DataCompound read(DataInStream in) throws IOException { DataCompound o = newCompound(); o.readData(in); return o; }