Class SeekableFileInputStream
java.lang.Object
java.io.InputStream
org.graalvm.shadowed.org.tukaani.xz.SeekableInputStream
org.graalvm.shadowed.org.tukaani.xz.SeekableFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Wraps a
RandomAccessFile
in a SeekableInputStream.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RandomAccessFileThe RandomAccessFile that has been wrapped into a SeekableFileInputStream. -
Constructor Summary
ConstructorsConstructorDescriptionSeekableFileInputStream(File file) Creates a new seekable input stream that reads from the specified file.SeekableFileInputStream(RandomAccessFile randomAccessFile) Creates a new seekable input stream from an existingRandomAccessFileobject.Creates a new seekable input stream that reads from a file with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()CallsrandomAccessFile.close().longlength()CallsrandomAccessFile.length().longposition()intread()CallsrandomAccessFile.read().intread(byte[] buf) CallsrandomAccessFile.read(buf).intread(byte[] buf, int off, int len) voidseek(long pos) CallsrandomAccessFile.seek(long).Methods inherited from class org.graalvm.shadowed.org.tukaani.xz.SeekableInputStream
skipMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Field Details
-
randomAccessFile
The RandomAccessFile that has been wrapped into a SeekableFileInputStream.
-
-
Constructor Details
-
SeekableFileInputStream
Creates a new seekable input stream that reads from the specified file.- Throws:
FileNotFoundException
-
SeekableFileInputStream
Creates a new seekable input stream that reads from a file with the specified name.- Throws:
FileNotFoundException
-
SeekableFileInputStream
Creates a new seekable input stream from an existingRandomAccessFileobject.
-
-
Method Details
-
read
CallsrandomAccessFile.read().- Specified by:
readin classInputStream- Throws:
IOException
-
read
CallsrandomAccessFile.read(buf).- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
CallsrandomAccessFile.close().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
length
CallsrandomAccessFile.length().- Specified by:
lengthin classSeekableInputStream- Throws:
IOException
-
position
- Specified by:
positionin classSeekableInputStream- Throws:
IOException
-
seek
CallsrandomAccessFile.seek(long).- Specified by:
seekin classSeekableInputStream- Parameters:
pos- new read position in the stream- Throws:
IOException- ifposis negative or if a stream-specific I/O error occurs
-