@Public public abstract class SeekableInputStream extends InputStream
SeekableInputStream
provides seek methods.Constructor and Description |
---|
SeekableInputStream() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
abstract long |
getPos()
Gets the current position in the input stream.
|
abstract int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the input stream into an array of bytes. |
abstract void |
seek(long desired)
Seek to the given offset from the start of the file.
|
available, mark, markSupported, read, read, reset, skip
public abstract void seek(long desired) throws IOException
desired
- the desired offsetIOException
- Thrown if an error occurred while seeking inside the input stream.public abstract long getPos() throws IOException
IOException
- Thrown if an I/O error occurred in the underlying stream implementation
while accessing the stream's position.public abstract int read(byte[] b, int off, int len) throws IOException
len
bytes of data from the input stream into an array of bytes. An
attempt is made to read as many as len
bytes, but a smaller number may be read.
The number of bytes actually read is returned as an integer.read
in class InputStream
IOException
public abstract void close() throws IOException
The close
method of InputStream
does nothing.
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- if an I/O error occurs.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.