|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.fasteasytrade.JRandTest.IO.FileRandomStream
This class represents an encrypted or random source file. Data, bytes or int32, are read from file.
| Field Summary | |
int |
actualSize
|
byte[] |
buffer
|
int |
count
|
int |
countLastRead
|
String |
filename
|
(package private) BufferedInputStream |
infile
|
boolean |
open
|
int |
SIZE
|
| Constructor Summary | |
FileRandomStream()
|
|
FileRandomStream(String s)
|
|
| Method Summary | |
boolean |
closeInputStream()
close the input stream. |
void |
finalize()
Be sure to close input file at end of processing. |
String |
getFilename()
get the file name to be processed. this file is the raw data to be read, or the input file processed by algorithm. |
boolean |
isOpen()
check if RandomStream is open |
boolean |
openInputStream()
open the input stream. |
byte |
readByte()
read one byte from a file. |
int |
readInt()
Processing is similar to readByte. |
long |
readLong()
Processing is similar to readByte. |
void |
setFilename(String s)
set file name to be processed. this file is the raw data to be read, or the input file processed by algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean open
BufferedInputStream infile
public String filename
public int count
public int SIZE
public int countLastRead
public int actualSize
public byte[] buffer
| Constructor Detail |
public FileRandomStream()
public FileRandomStream(String s)
| Method Detail |
public String getFilename()
RandomStream
getFilename in interface RandomStreamRandomStream.getFilename()public void setFilename(String s)
RandomStream
setFilename in interface RandomStreamRandomStream.setFilename(java.lang.String)public boolean isOpen()
RandomStream
isOpen in interface RandomStreamRandomStream.isOpen()
public boolean openInputStream()
throws Exception
RandomStream
openInputStream in interface RandomStreamException - -
Usually IOException.RandomStream.openInputStream()public boolean closeInputStream()
RandomStream
closeInputStream in interface RandomStreamRandomStream.closeInputStream()
public byte readByte()
throws Exception
RandomStreamfirst time ( if !isOpen() ) open file/stream, and return byte
at end of file close stream and returns -1
readByte in interface RandomStreamExceptionRandomStream.readByte()
public int readInt()
throws Exception
RandomStream
readInt in interface RandomStreamExceptionRandomStream.readInt()
public long readLong()
throws Exception
RandomStream
readLong in interface RandomStreamExceptionRandomStream.readLong()public void finalize()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||