Class CloneableFileReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Cloneable, java.lang.Readable

    public class CloneableFileReader
    extends java.io.Reader
    implements java.lang.Cloneable
    Simple Cloneable File Reader to allow cloning pull parsers efficiently.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String filename  
      (package private) java.io.FileReader freader  
      (package private) long position  
      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      CloneableFileReader​(java.lang.String filename)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      void close()  
      int read​(char[] cbuf, int offset, int length)  
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • freader

        java.io.FileReader freader
      • filename

        java.lang.String filename
      • position

        long position
    • Constructor Detail

      • CloneableFileReader

        public CloneableFileReader​(java.lang.String filename)
                            throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • read

        public int read​(char[] cbuf,
                        int offset,
                        int length)
                 throws java.io.IOException
        Specified by:
        read in class java.io.Reader
        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.Reader
        Throws:
        java.io.IOException