public abstract class SeekableInputStream extends InputStream
This interface provides for reading bytes from an OffHeap File.
It is generally true of all the reading routines in this interface that if end of file is reached before the desired number of bytes has been read, an EOFException (which is a kind of IOException) is thrown. If any byte cannot be read for any reason other than end of file, an IOException other than EOFException is thrown. In particular, an IOException may be thrown if the input stream has been closed.
| Constructor and Description |
|---|
SeekableInputStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes this stream and releases any system resources associated with the stream.
|
abstract long |
getFilePointer()
Returns the current offset in this file.
|
abstract int |
read() |
abstract void |
readBytes(byte[] b,
int offset,
int len) |
abstract void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read occurs.
|
available, mark, markSupported, read, read, reset, skippublic abstract int read()
throws IOException
read in class InputStreamIOExceptionpublic abstract void readBytes(byte[] b,
int offset,
int len)
throws IOException
IOExceptionpublic abstract long getFilePointer()
throws IOException
IOException - if an I/O error occurs.public abstract void close()
throws IOException
Closes this stream and releases any system resources associated with the stream.
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - if an I/O error occurs.public abstract void seek(long pos)
throws IOException,
EOFException
pos - - the offset position, measured in bytes from the beginning of the file, at which to set the file
pointer.IOException - if pos is less than 0 or if an I/O error occurs.EOFException - if pos beyond end of fileCopyright © 2015–2024. All rights reserved.