/** * Prints out this text to the specified writer. * * @param writer the destination writer. */ public void print(Writer writer) throws IOException { if (_data != null) { // Primitive writer.write(_data, 0, _count); } else { // Composite. _head.print(writer); _tail.print(writer); } }
/** * Prints out this text to the specified writer and then terminates the line. * * @param writer the destination writer. */ public void println(Writer writer) throws IOException { print(writer); writer.write('\n'); }