Class LocalSeekableInputStream

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

    public class LocalSeekableInputStream
    extends SeekableInputStream
    Seekable input stream implementation for local files.
    • Constructor Detail

      • LocalSeekableInputStream

        public LocalSeekableInputStream​(java.io.File file)
        Parameters:
        file - File to create a stream for.
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • close

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

        public boolean canSeekHard()
        Specified by:
        canSeekHard in class SeekableInputStream
        Returns:
        true if it is possible to seek to an arbitrary position in this stream, even when it is behind the current position.
      • seekHard

        protected void seekHard​(long position)
                         throws java.io.IOException
        Specified by:
        seekHard in class SeekableInputStream
        Throws:
        java.io.IOException