- for (Contact contact : card.getContactsList()) {
- builder.append(toString(contact, -1));
+ return lines;
+ }
+
+ /**
+ * Write the given {@link Contact} in the {@link Appendable}.
+ *
+ * @param writer
+ * the {@link Appendable}
+ * @param contact
+ * the {@link Contact} to write
+ * @param startingBKey
+ * the starting BKey number (all the other will follow) or -1 for
+ * no BKey
+ *
+ * @throws IOException
+ * in case of IO error
+ */
+ public static void write(Appendable writer, Contact contact,
+ int startingBKey) throws IOException {
+ for (String s : toStrings(contact, startingBKey)) {
+ writer.append(s);
+ writer.append('\n');