Class StringPrintWriter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public class StringPrintWriter
    extends PrintWriter
    Simple extension of PrintWriter so you don't have to create a StringWriter to pass to it, when you want the functionality of PrintWriter but you want it in a buffer.
    • Constructor Detail

      • StringPrintWriter

        public StringPrintWriter()
        Create with the default initial size.
      • StringPrintWriter

        public StringPrintWriter​(int initSize)
        Create with an initialize size with the parameter supplied..
    • Method Detail

      • getString

        public String getString()
        Return the string in the internal string writer.
      • getReader

        public Reader getReader()
        Return a reader for the accumulated string.
      • println

        public void println​(String[] value)
        Call println for every string in the array.
      • print

        public void print​(String[] value)
        Call print for every string in the array.
        Throws:
        NullPointerException - if value is null.
      • clear

        public void clear()
        Clear out the underlying string writer.