public class RandomAccessInputStream extends SeekInputStream
| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
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) |
public RandomAccessInputStream(java.io.RandomAccessFile raf)
throws java.io.IOException
raf - RandomAccessFile to wrap.java.io.IOExceptionpublic 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.IOExceptionpublic 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.IOExceptionpublic 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.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic long position()
throws java.io.IOException
java.io.IOExceptionpublic void position(long position)
throws java.io.IOException
java.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
SeekInputStreammarkSupported in class SeekInputStreampublic void mark(int readlimit)
SeekInputStreammark in class SeekInputStreamreadlimit - ignoredpublic void reset()
throws java.io.IOException
SeekInputStreamreset in class SeekInputStreamjava.io.IOException - if there is no mark, or if an IO error occurspublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionCopyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.