@Override public void writeTo(ProtoStreamWriter writer, Account account) throws IOException { writer.writeInt("id", account.getId()); writer.writeString("description", account.getDescription()); writer.writeDate("creationDate", account.getCreationDate()); writer.writeObject("limits", account.getLimits(), Account.Limits.class); writer.writeObject("hardLimits", account.getHardLimits(), Account.Limits.class); writer.writeCollection("blurb", account.getBlurb(), byte[].class); writer.writeArray("currencies", account.getCurrencies(), Account.Currency.class); } }