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) . |
skip
available, mark, markSupported, reset
protected RandomAccessFile randomAccessFile
public SeekableFileInputStream(File file) throws FileNotFoundException
FileNotFoundException
public SeekableFileInputStream(String name) throws FileNotFoundException
FileNotFoundException
public SeekableFileInputStream(RandomAccessFile randomAccessFile)
RandomAccessFile
object.public int read() throws IOException
randomAccessFile.read()
.read
in class InputStream
IOException
public int read(byte[] buf) throws IOException
randomAccessFile.read(buf)
.read
in class InputStream
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
randomAccessFile.close()
.close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public long length() throws IOException
randomAccessFile.length()
.length
in class SeekableInputStream
IOException
public long position() throws IOException
position
in class SeekableInputStream
IOException
public void seek(long pos) throws IOException
randomAccessFile.seek(long)
.seek
in class SeekableInputStream
pos
- new read position in the streamIOException
- if pos
is negative or if
a stream-specific I/O error occursCopyright © 2016 Internet2. All rights reserved.