public class SeekableFileInputStream extends SeekableInputStream
RandomAccessFile
in a SeekableInputStream.| Modifier and Type | Field and Description |
|---|---|
protected RandomAccessFile |
randomAccessFile
The RandomAccessFile that has been wrapped
into a SeekableFileInputStream.
|
| Constructor and Description |
|---|
SeekableFileInputStream(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 existing
RandomAccessFile object. |
SeekableFileInputStream(String name)
Creates a new seekable input stream that reads from a file with
the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Calls
randomAccessFile.close(). |
long |
length()
Calls
randomAccessFile.length(). |
long |
position()
|
int |
read()
Calls
randomAccessFile.read(). |
int |
read(byte[] buf)
Calls
randomAccessFile.read(buf). |
int |
read(byte[] buf,
int off,
int len)
|
void |
seek(long pos)
Calls
randomAccessFile.seek(long). |
skipavailable, mark, markSupported, resetprotected RandomAccessFile randomAccessFile
public SeekableFileInputStream(File file) throws FileNotFoundException
FileNotFoundExceptionpublic SeekableFileInputStream(String name) throws FileNotFoundException
FileNotFoundExceptionpublic SeekableFileInputStream(RandomAccessFile randomAccessFile)
RandomAccessFile object.public int read()
throws IOException
randomAccessFile.read().read in class InputStreamIOExceptionpublic int read(byte[] buf)
throws IOException
randomAccessFile.read(buf).read in class InputStreamIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
randomAccessFile.close().close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic long length()
throws IOException
randomAccessFile.length().length in class SeekableInputStreamIOExceptionpublic long position()
throws IOException
position in class SeekableInputStreamIOExceptionpublic void seek(long pos)
throws IOException
randomAccessFile.seek(long).seek in class SeekableInputStreampos - new read position in the streamIOException - if pos is negative or if
a stream-specific I/O error occursCopyright © 2016 Internet2. All rights reserved.