|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 RandomStream
RandomStream.getFilename()
public void setFilename(String s)
RandomStream
setFilename
in interface RandomStream
RandomStream.setFilename(java.lang.String)
public boolean isOpen()
RandomStream
isOpen
in interface RandomStream
RandomStream.isOpen()
public boolean openInputStream() throws Exception
RandomStream
openInputStream
in interface RandomStream
Exception
- -
Usually IOException.RandomStream.openInputStream()
public boolean closeInputStream()
RandomStream
closeInputStream
in interface RandomStream
RandomStream.closeInputStream()
public byte readByte() throws Exception
RandomStream
first time ( if !isOpen() ) open file/stream, and return byte
at end of file close stream and returns -1
readByte
in interface RandomStream
Exception
RandomStream.readByte()
public int readInt() throws Exception
RandomStream
readInt
in interface RandomStream
Exception
RandomStream.readInt()
public long readLong() throws Exception
RandomStream
readLong
in interface RandomStream
Exception
RandomStream.readLong()
public void finalize()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |