|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.DataFile
public class DataFile
DataFile provides Stream to read and write to the files.
| Constructor Summary | |
|---|---|
DataFile(java.lang.String fileName,
java.lang.String type)
Constructs DataFile object for given file name and mode of opening file like
"r", "w" and throws null point exception in read mode |
|
| Method Summary | |
|---|---|
void |
close()
Closes the opened Files |
int |
readInt()
readInt reads a int bit into memory |
long |
readLong()
Reads a long value from the file |
void |
writeDouble(double bit)
writeDouble writes a double bit to file or stream |
void |
writeInt(int bit)
writeInt writes a int bit to file or stream |
void |
writeLong(long bit)
writeLong writes a long bit to file or stream |
void |
writeString(java.lang.String str)
writeString writes a String to file or stream |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataFile(java.lang.String fileName,
java.lang.String type)
throws java.lang.NullPointerException,
java.io.IOException
DataFile object for given file name and mode of opening file like
"r", "w" and throws null point exception in read mode
fileName - holds file name of the streamtype -
java.lang.NullPointerException
java.io.IOException - if file does not exist or unable to write to the stream| Method Detail |
|---|
public void writeInt(int bit)
throws java.io.IOException
writeInt writes a int bit to file or stream
bit -
java.io.IOException
public void writeLong(long bit)
throws java.io.IOException
writeLong writes a long bit to file or stream
bit -
java.io.IOException
public void writeDouble(double bit)
throws java.io.IOException
writeDouble writes a double bit to file or stream
bit -
java.io.IOException
public void writeString(java.lang.String str)
throws java.io.IOException
writeString writes a String to file or stream
str -
java.io.IOException
public int readInt()
throws java.io.IOException
readInt reads a int bit into memory
int type
java.io.IOException - if unable to read from File
public long readLong()
throws java.io.IOException
long type
- Throws:
java.io.IOException - if unable to access
public void close()
throws java.io.IOException
java.io.IOException - if the file is not accessible.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||