Class TruncatingBufferedWriter

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

    final class TruncatingBufferedWriter
    extends java.io.Writer
    implements java.lang.CharSequence
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char[] buffer  
      private int position  
      private boolean truncated  
      • Fields inherited from class java.io.Writer

        lock
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Writer append​(char c)  
      java.io.Writer append​(java.lang.CharSequence seq)  
      java.io.Writer append​(java.lang.CharSequence seq, int start, int end)  
      (package private) char[] buffer()  
      (package private) int capacity()  
      char charAt​(int index)  
      void close()  
      void flush()  
      (package private) int indexOf​(java.lang.CharSequence seq)  
      int length()  
      (package private) int position()  
      (package private) void position​(int index)  
      java.lang.String subSequence​(int startIndex, int endIndex)  
      java.lang.String toString()  
      (package private) boolean truncated()  
      void write​(char[] source)  
      void write​(char[] source, int offset, int length)  
      void write​(int c)  
      void write​(java.lang.String string)  
      void write​(java.lang.String string, int offset, int length)  
      • Methods inherited from class java.io.Writer

        nullWriter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints
    • Field Detail

      • buffer

        private final char[] buffer
      • position

        private int position
      • truncated

        private boolean truncated
    • Constructor Detail

      • TruncatingBufferedWriter

        TruncatingBufferedWriter​(int capacity)
    • Method Detail

      • buffer

        char[] buffer()
      • position

        int position()
      • position

        void position​(int index)
      • capacity

        int capacity()
      • truncated

        boolean truncated()
      • write

        public void write​(int c)
        Overrides:
        write in class java.io.Writer
      • write

        public void write​(char[] source)
        Overrides:
        write in class java.io.Writer
      • write

        public void write​(char[] source,
                          int offset,
                          int length)
        Specified by:
        write in class java.io.Writer
      • write

        public void write​(java.lang.String string)
        Overrides:
        write in class java.io.Writer
      • write

        public void write​(java.lang.String string,
                          int offset,
                          int length)
        Overrides:
        write in class java.io.Writer
      • append

        public java.io.Writer append​(char c)
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
      • append

        public java.io.Writer append​(java.lang.CharSequence seq)
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
      • append

        public java.io.Writer append​(java.lang.CharSequence seq,
                                     int start,
                                     int end)
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
      • indexOf

        int indexOf​(java.lang.CharSequence seq)
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.String subSequence​(int startIndex,
                                            int endIndex)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • flush

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

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Writer
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object