public class FileProcessor
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.io.BufferedReader |
inputReaderObj
Reader object for input file.
|
java.io.PrintWriter |
outputWriterObj
Writer object for output file.
|
| Constructor and Description |
|---|
FileProcessor(java.lang.String inFName,
java.lang.String outFName)
Creates a file processor object and opens input and output files.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeInputFile()
Closes the input file.
|
void |
closeOutputFile()
Closes the output file.
|
java.lang.String |
readNextLine()
Reads and returns the next line of data from the input file.
|
void |
writeNextLine(java.lang.String str)
Writes the given line of data to the output file.
|
public java.io.BufferedReader inputReaderObj
public java.io.PrintWriter outputWriterObj
public FileProcessor(java.lang.String inFName,
java.lang.String outFName)
throws java.io.FileNotFoundException,
java.io.IOException
inFName - name of input text file to use.outFName - name of output text file to use.java.io.FileNotFoundException - if the input file is not found.java.io.IOException - if an I/O error occurs.public java.lang.String readNextLine()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.public void writeNextLine(java.lang.String str)
throws java.io.IOException
str - a string containing the line of data to be written.java.io.IOException - if an I/O error occurs.public void closeInputFile()
public void closeOutputFile()