Package org.apache.hadoop.fs
Interface Seekable
- All Known Implementing Classes:
BlockDecompressorStream,CompressionInputStream,DecompressorStream,FSDataInputStream,FSInputStream,HdfsDataInputStream,SplitCompressionInputStream
@Public
@Evolving
public interface Seekable
Stream that permits seeking.
-
Method Summary
-
Method Details
-
seek
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 file.- Parameters:
pos- offset from the start of the file.- Throws:
IOException- raised on errors performing I/O.
-
getPos
Return the current offset from the start of the file- Returns:
- offset from the start of the file.
- Throws:
IOException- raised on errors performing I/O.
-
seekToNewSource
Seeks a different copy of the data. Returns true if found a new source, false otherwise.- Parameters:
targetPos- target position.- Returns:
- true if found a new source, false otherwise.
- Throws:
IOException- raised on errors performing I/O.
-