Class ThrowingPrintWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class ThrowingPrintWriter
    extends java.io.Writer
    An alternative PrintWriter that doesn't catch exceptions.
    Since:
    2.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String LF  
      private java.io.Writer out  
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      ThrowingPrintWriter​(java.io.Writer out)
      Construct a JGitPrintWriter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      void flush()
      void format​(java.lang.String fmt, java.lang.Object... args)
      Print a formatted message according to String.format(String, Object...).
      void print​(char value)
      Print a char
      void print​(int value)
      Print an int as string
      void print​(long value)
      Print a long as string
      void print​(short value)
      Print a short as string
      void print​(java.lang.Object any)
      Print an object's toString representations
      void println()
      Print a platform dependent new line
      void println​(java.lang.String s)
      Print a string and terminate with a line feed.
      void write​(char[] cbuf, int off, int len)
      • Methods inherited from class java.io.Writer

        append, append, append, write, write, write, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • out

        private final java.io.Writer out
      • LF

        private final java.lang.String LF
    • Constructor Detail

      • ThrowingPrintWriter

        public ThrowingPrintWriter​(java.io.Writer out)
        Construct a JGitPrintWriter
        Parameters:
        out - the underlying Writer
    • Method Detail

      • write

        public void write​(char[] cbuf,
                          int off,
                          int len)
                   throws java.io.IOException
        Specified by:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in class java.io.Writer
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Writer
        Throws:
        java.io.IOException
      • println

        public void println​(java.lang.String s)
                     throws java.io.IOException
        Print a string and terminate with a line feed.
        Parameters:
        s - a String object.
        Throws:
        java.io.IOException
      • println

        public void println()
                     throws java.io.IOException
        Print a platform dependent new line
        Throws:
        java.io.IOException
      • print

        public void print​(char value)
                   throws java.io.IOException
        Print a char
        Parameters:
        value - a char.
        Throws:
        java.io.IOException
      • print

        public void print​(int value)
                   throws java.io.IOException
        Print an int as string
        Parameters:
        value - an int.
        Throws:
        java.io.IOException
      • print

        public void print​(long value)
                   throws java.io.IOException
        Print a long as string
        Parameters:
        value - a long.
        Throws:
        java.io.IOException
      • print

        public void print​(short value)
                   throws java.io.IOException
        Print a short as string
        Parameters:
        value - a short.
        Throws:
        java.io.IOException
      • format

        public void format​(java.lang.String fmt,
                           java.lang.Object... args)
                    throws java.io.IOException
        Print a formatted message according to String.format(String, Object...).
        Parameters:
        fmt - a String object.
        args - objects.
        Throws:
        java.io.IOException
      • print

        public void print​(java.lang.Object any)
                   throws java.io.IOException
        Print an object's toString representations
        Parameters:
        any - an object.
        Throws:
        java.io.IOException