|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.archive.io.SeekInputStream
org.archive.io.RandomAccessInputStream
public class RandomAccessInputStream
Wraps a RandomAccessFile with an InputStream interface.
| Constructor Summary | |
|---|---|
RandomAccessInputStream(java.io.File file)
Constructor. |
|
RandomAccessInputStream(java.io.File file,
long offset)
Constructor. |
|
RandomAccessInputStream(java.io.RandomAccessFile raf)
Constructor. |
|
RandomAccessInputStream(java.io.RandomAccessFile raf,
boolean sympathyClose,
long offset)
|
|
| Method Summary | |
|---|---|
int |
available()
|
void |
close()
|
void |
mark(int readlimit)
Marks the current position of the stream. |
boolean |
markSupported()
Returns true, since SeekInputStreams support mark/reset by default. |
long |
position()
|
void |
position(long position)
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
Resets this stream to its marked position. |
long |
skip(long n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomAccessInputStream(java.io.RandomAccessFile raf)
throws java.io.IOException
raf - RandomAccessFile to wrap.
java.io.IOException
public RandomAccessInputStream(java.io.File file)
throws java.io.IOException
file - File to get RAFIS on. Creates an RAF from passed file.
Closes the created RAF when this stream is closed.
java.io.IOException
public RandomAccessInputStream(java.io.File file,
long offset)
throws java.io.IOException
file - File to get RAFIS on. Creates an RAF from passed file.
Closes the created RAF when this stream is closed.offset -
java.io.IOException
public RandomAccessInputStream(java.io.RandomAccessFile raf,
boolean sympathyClose,
long offset)
throws java.io.IOException
raf - RandomAccessFile to wrap.sympathyClose - Set to true if we are to close the RAF
file when this stream is closed.offset -
java.io.IOException| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
public long position()
throws java.io.IOException
java.io.IOException
public void position(long position)
throws java.io.IOException
java.io.IOException
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
SeekInputStream
markSupported in class SeekInputStreampublic void mark(int readlimit)
SeekInputStream
mark in class SeekInputStreamreadlimit - ignored
public void reset()
throws java.io.IOException
SeekInputStream
reset in class SeekInputStreamjava.io.IOException - if there is no mark, or if an IO error occurs
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||