|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.kc7bfi.jflac.io.RandomFileInputStream
public class RandomFileInputStream
This is a FileInputStream that uses a Random Access File.
| Field Summary | |
|---|---|
protected RandomAccessFile |
randomFile
|
| Constructor Summary | |
|---|---|
RandomFileInputStream(File file)
Constructor. |
|
RandomFileInputStream(RandomAccessFile randomFile)
Constructor. |
|
RandomFileInputStream(String fileName)
Constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Close the file. |
void |
mark(int arg0)
|
boolean |
markSupported()
Is file marking supported. |
int |
read()
Read a byte value. |
int |
read(byte[] buffer)
Read bytes into an array. |
int |
read(byte[] buffer,
int pos,
int bytes)
Read bytes into an array. |
void |
reset()
|
void |
seek(long pos)
Seek to a position in the file. |
long |
skip(long bytes)
Skip bytes in the input file. |
| Methods inherited from class java.io.InputStream |
|---|
available |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RandomAccessFile randomFile
| Constructor Detail |
|---|
public RandomFileInputStream(File file)
throws FileNotFoundException
file - The File to read
FileNotFoundException - If file is not found
public RandomFileInputStream(String fileName)
throws FileNotFoundException
fileName - The name of the file to read
FileNotFoundException - If the file is not found.public RandomFileInputStream(RandomAccessFile randomFile)
randomFile - The file to read| Method Detail |
|---|
public int read()
throws IOException
read in class InputStreamIOException - on IO errorInputStream.read()public void reset()
reset in class InputStreamInputStream.reset()
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - on IO errorInputStream.close()public boolean markSupported()
markSupported in class InputStreamInputStream.markSupported()public void mark(int arg0)
mark in class InputStreamInputStream.mark(int)
public long skip(long bytes)
throws IOException
skip in class InputStreambytes - The number of bytes to skip
IOException - on IO errorInputStream.skip(long)
public int read(byte[] buffer)
throws IOException
read in class InputStreambuffer - The buffer to read bytes into
IOException - on IO errorInputStream.read(byte[])
public int read(byte[] buffer,
int pos,
int bytes)
throws IOException
read in class InputStreambuffer - The buffer to read bytes intopos - The start position in the bufferbytes - The number of bytes to read
IOException - on IO errorInputStream.read(byte[], int, int)
public void seek(long pos)
throws IOException
pos - The seek position
IOException - On error seeking
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||