org.apache.pig.backend.datastorage
Class SeekableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.pig.backend.datastorage.SeekableInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
HSeekableInputStream

public abstract class SeekableInputStream
extends InputStream

Unix-like API for an input stream that supports random access.


Nested Class Summary
static class SeekableInputStream.FLAGS
           
 
Constructor Summary
SeekableInputStream()
           
 
Method Summary
abstract  void seek(long offset, SeekableInputStream.FLAGS whence)
          Seeks to a given offset as specified by whence flags.
abstract  long tell()
          Returns current offset
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeekableInputStream

public SeekableInputStream()
Method Detail

seek

public abstract void seek(long offset,
                          SeekableInputStream.FLAGS whence)
                   throws IOException
Seeks to a given offset as specified by whence flags. If whence is SEEK_SET, offset is added to beginning of stream If whence is SEEK_CUR, offset is added to current position inside stream If whence is SEEK_END, offset is added to end of file position

Parameters:
offset -
whence -
Throws:
IOException

tell

public abstract long tell()
                   throws IOException
Returns current offset

Returns:
offset
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation