org.apache.hadoop.fs
Interface Seekable

All Known Implementing Classes:
BlockDecompressorStream, BufferedFSInputStream, CompressionInputStream, DecompressorStream, FSDataInputStream, FSInputChecker, FSInputStream, FTPInputStream, SplitCompressionInputStream

public interface Seekable

Stream that permits seeking.


Method Summary
 long getPos()
          Return the current offset from the start of the file
 void seek(long pos)
          Seek to the given offset from the start of the file.
 boolean seekToNewSource(long targetPos)
          Seeks a different copy of the data.
 

Method Detail

seek

void seek(long pos)
          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 file.

Throws:
IOException

getPos

long getPos()
            throws IOException
Return the current offset from the start of the file

Throws:
IOException

seekToNewSource

boolean seekToNewSource(long targetPos)
                        throws IOException
Seeks a different copy of the data. Returns true if found a new source, false otherwise.

Throws:
IOException


Copyright © 2009 The Apache Software Foundation