writeDescription(description, out); saveConvert(key, ESCAPE_KEY, out); out.write("="); saveConvert(value, ESCAPE_VALUE, out); out.write(END_OF_LINE);
/** * Writes a descriptive comment into the given print writer. * * @param text the text to be written. If it contains more than * one line, every line will be prepended by the comment character. * @param writer the writer that should receive the content. * @throws IOException if writing fails */ private void writeDescription(final String text, final Writer writer) throws IOException { // check if empty content ... this case is easy ... if (text.length() == 0) { return; } writer.write("# "); writer.write(END_OF_LINE); final LineBreakIterator iterator = new LineBreakIterator(text); while (iterator.hasNext()) { writer.write("# "); saveConvert((String) iterator.next(), ESCAPE_COMMENT, writer); writer.write(END_OF_LINE); } }
/** * Writes a descriptive comment into the given print writer. * * @param text the text to be written. If it contains more than * one line, every line will be prepended by the comment character. * @param writer the writer that should receive the content. * @throws IOException if writing fails */ private void writeDescription(final String text, final Writer writer) throws IOException { // check if empty content ... this case is easy ... if (text.length() == 0) { return; } writer.write("# "); writer.write(END_OF_LINE); final LineBreakIterator iterator = new LineBreakIterator(text); while (iterator.hasNext()) { writer.write("# "); saveConvert((String) iterator.next(), ESCAPE_COMMENT, writer); writer.write(END_OF_LINE); } }
writeDescription(description, out); saveConvert(key, ESCAPE_KEY, out); out.write("="); saveConvert(value, ESCAPE_VALUE, out); out.write(END_OF_LINE);
writeDescription(description, out); saveConvert(key, ESCAPE_KEY, out); out.write("="); saveConvert(value, ESCAPE_VALUE, out); out.write(END_OF_LINE);
/** * Writes a descriptive comment into the given print writer. * * @param text the text to be written. If it contains more than * one line, every line will be prepended by the comment character. * @param writer the writer that should receive the content. * @throws IOException if writing fails */ private void writeDescription(final String text, final Writer writer) throws IOException { // check if empty content ... this case is easy ... if (text.length() == 0) { return; } writer.write("# "); writer.write(END_OF_LINE); final LineBreakIterator iterator = new LineBreakIterator(text); while (iterator.hasNext()) { writer.write("# "); saveConvert((String) iterator.next(), ESCAPE_COMMENT, writer); writer.write(END_OF_LINE); } }