Package org.apache.flink.core.fs
Class FSDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
ByteBufferReadableFSDataInputStream
,CachedDataInputStream
,CompressibleFSDataInputStream
,FSDataInputStreamWrapper
,HadoopDataInputStream
,InputStreamFSInputWrapper
,LocalDataInputStream
@Public public abstract class FSDataInputStream extends InputStream
Interface for a data input stream to a file on aFileSystem
.This extends the
InputStream
with methods for accessing the stream'scurrent position
andseeking
to a desired position.
-
-
Constructor Summary
Constructors Constructor Description FSDataInputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract long
getPos()
Gets the current position in the input stream.abstract void
seek(long desired)
Seek to the given offset from the start of the file.-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Method Detail
-
seek
public abstract void seek(long desired) throws IOException
Seek to the given offset from the start of the file. The next read() will be from that location. Can't seek past the end of the stream.- Parameters:
desired
- the desired offset- Throws:
IOException
- Thrown if an error occurred while seeking inside the input stream.
-
getPos
public abstract long getPos() throws IOException
Gets the current position in the input stream.- Returns:
- current position in the input stream
- Throws:
IOException
- Thrown if an I/O error occurred in the underlying stream implementation while accessing the stream's position.
-
-