Class FileInput

java.lang.Object
eu.bandm.tools.util.files.FileInput
All Implemented Interfaces:
TextInput, AutoCloseable

class FileInput extends Object implements TextInput
Subclass which uses a File for input.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final Charset
    The encoding to apply when reading the file.
    (package private) final File
    The file to read.
    (package private) final String
    The human-read source info, as used in error messages, etc.
    (package private) final Reader
    The reader constructed for the given file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileInput(File file, Charset encoding)
    Only constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deliver a human readable text for the source identification.
    Deliver the stream of decoded characters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface eu.bandm.tools.util.files.TextInput

    close
  • Field Details

    • file

      final File file
      The file to read.
    • info

      final String info
      The human-read source info, as used in error messages, etc.
    • encoding

      final Charset encoding
      The encoding to apply when reading the file.
    • reader

      final Reader reader
      The reader constructed for the given file.
  • Constructor Details

    • FileInput

      FileInput(File file, Charset encoding)
      Only constructor. Opens the file and creates a reader.
      Parameters:
      file - to read
      encoding - to use
  • Method Details

    • getReader

      public Reader getReader()
      Deliver the stream of decoded characters.
      Specified by:
      getReader in interface TextInput
      Returns:
      the stream of decoded characters.
    • getInfo

      public String getInfo()
      Deliver a human readable text for the source identification.
      Specified by:
      getInfo in interface TextInput
      Returns:
      a human readable text for the source identification.