/** * Method responsible for comunicating with the Server, writing information to the * DataOutputStream. * * @param out The DataOutputStream where we are going to write the information about the idea. * @return A boolean value, indicating the success or failure of the operation. */ public boolean writeToDataStream(DataOutputStream out) { if (!Common.sendInt(id, out)) return false; if (!Common.sendInt(uid, out)) return false; if (!Common.sendString(title, out)) return false; if (!Common.sendString(body, out)) return false; if (!Common.sendString(file, out)) return false; if (!Common.sendInt(shares_to_buy, out)) return false; if (!Common.sendInt(numSharesOwned, out)) return false; if (!Common.sendFloat(percentOwned, out)) return false; if (!Common.sendInt(inWatchList ? 1 : 0, out)) return false; if (!Common.sendFloat(sellingPrice, out)) return false; if (!Common.sendFloat(marketValue, out)) return false; if (!Common.sendInt(facebookId, out)) return false; return true; }