public class SeekableFileInputStream extends SeekableInputStream
RandomAccessFile
in a SeekableInputStream.限定符和类型 | 字段和说明 |
---|---|
protected RandomAccessFile |
randomAccessFile
The RandomAccessFile that has been wrapped
into a SeekableFileInputStream.
|
构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
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
public SeekableFileInputStream(String name) throws FileNotFoundException
public SeekableFileInputStream(RandomAccessFile randomAccessFile)
RandomAccessFile
object.public int read() throws IOException
randomAccessFile.read()
.read
在类中 InputStream
IOException
public int read(byte[] buf) throws IOException
randomAccessFile.read(buf)
.read
在类中 InputStream
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
在类中 InputStream
IOException
public void close() throws IOException
randomAccessFile.close()
.close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 InputStream
IOException
public long length() throws IOException
randomAccessFile.length()
.length
在类中 SeekableInputStream
IOException
public long position() throws IOException
position
在类中 SeekableInputStream
IOException
public void seek(long pos) throws IOException
randomAccessFile.seek(long)
.seek
在类中 SeekableInputStream
pos
- new read position in the streamIOException
- if pos
is negative or if
a stream-specific I/O error occurs