Class BinFileInput<T>

  • All Implemented Interfaces:
    FileInput<T>, Input<T>, java.io.Closeable, java.lang.AutoCloseable

    public class BinFileInput<T>
    extends BinInput<T>
    implements FileInput<T>
    An item input implementation deserializing something from the specified file.
    • Constructor Summary

      Constructors 
      Constructor Description
      BinFileInput​(java.nio.file.Path srcPath)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.io.ObjectInputStream buildObjectInputStream​(java.nio.file.Path itemsSrcPath)  
      java.nio.file.Path getFilePath()  
      void reset()
      Reset this input making this readable from the beginning
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

        close
      • Methods inherited from interface com.github.akurilov.commons.io.Input

        get, get, skip
    • Field Detail

      • srcPath

        protected final java.nio.file.Path srcPath
    • Constructor Detail

      • BinFileInput

        public BinFileInput​(java.nio.file.Path srcPath)
                     throws java.io.IOException
        Parameters:
        srcPath - the path to the file which should be used to restore the serialized items
        Throws:
        java.io.IOException - if unable to open the file for reading
    • Method Detail

      • buildObjectInputStream

        protected static java.io.ObjectInputStream buildObjectInputStream​(java.nio.file.Path itemsSrcPath)
                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class BinInput<T>
      • getFilePath

        public final java.nio.file.Path getFilePath()
        Specified by:
        getFilePath in interface FileInput<T>
      • reset

        public void reset()
                   throws java.io.IOException
        Description copied from interface: Input
        Reset this input making this readable from the beginning
        Specified by:
        reset in interface Input<T>
        Overrides:
        reset in class BinInput<T>
        Throws:
        java.io.IOException