Class RandomAccessFileInputStream

    • Method Detail

      • available

        public int available()
                      throws java.io.IOException
        Gets an estimate of the number of bytes that can be read (or skipped over) from this input stream.

        If there are more than Integer.MAX_VALUE bytes available, return Integer.MAX_VALUE.

        Overrides:
        available in class java.io.InputStream
        Returns:
        An estimate of the number of bytes that can be read.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • availableLong

        public long availableLong()
                           throws java.io.IOException
        Gets the number of bytes that can be read (or skipped over) from this input stream.
        Returns:
        The number of bytes that can be read.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • 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 AbstractInputStream
        Throws:
        java.io.IOException
      • copy

        public long copy​(long pos,
                         long size,
                         java.io.OutputStream os)
                  throws java.io.IOException
        Copies our bytes from the given starting position for a size to the output stream.
        Parameters:
        pos - Where to start copying. The offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
        size - The number of bytes to copy.
        os - Where to copy.
        Returns:
        The number of bytes copied.
        Throws:
        java.io.IOException - if pos is less than 0 or if an I/O error occurs.
        Since:
        2.19.0
      • getRandomAccessFile

        public java.io.RandomAccessFile getRandomAccessFile()
        Gets the underlying file.
        Returns:
        the underlying file.
      • isCloseOnClose

        public boolean isCloseOnClose()
        Tests whether to close the underlying file when this stream is closed, defaults to false for compatibility.
        Returns:
        Whether to close the underlying file when this stream is closed.
      • 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[] bytes)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] bytes,
                        int offset,
                        int length)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

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