org.apache.lucene.util
Class RandomAccessInputStream

Object
  extended by InputStream
      extended by RandomAccessInputStream
All Implemented Interfaces:
Closeable

public class RandomAccessInputStream
extends InputStream

Provides a handy InputStream wrapper around a RandomAccessFile.

Author:
Martin Haye

Field Summary
private  RandomAccessFile in
          The file that will be read from
 
Constructor Summary
RandomAccessInputStream(RandomAccessFile in)
          Wrap a RandomAccessFile
 
Method Summary
 void close()
           
 long getFilePointer()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void seek(long n)
           
 long skip(long n)
           
 
Methods inherited from class InputStream
available, mark, markSupported, reset
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private RandomAccessFile in
The file that will be read from

Constructor Detail

RandomAccessInputStream

public RandomAccessInputStream(RandomAccessFile in)
Wrap a RandomAccessFile

Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

seek

public void seek(long n)
          throws IOException
Throws:
IOException

getFilePointer

public long getFilePointer()
                    throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException