public abstract class Converter extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoStreamClose
Set to true if the output stream automatically closes after the conversion
|
protected OutputStream |
outStream
Stream to which the AVCL will be written
|
Constructor and Description |
---|
Converter(File outFile)
Creates the input streams and assigns the local variables assigning conversion
output sources
|
Converter(OutputStream outStream)
Creates a converter and sets the output stream for the result, but nothing else
|
Converter(String outFile)
Creates the input streams and assigns the local variables from which
|
Modifier and Type | Method and Description |
---|---|
void |
closeStream()
Manually closes the output stream of the converter
Separated from the run method to allow the stream to remain open
if required for multiple conversions over the same pipe
(e.g., communications or high level vehicle control)
|
void |
run() |
abstract boolean |
runConversion()
Executes the actual conversion and writes the results to the designated output file
|
void |
setAutoStreamClose(boolean value)
Sets automatic output stream closing to true or false
|
protected OutputStream outStream
protected boolean autoStreamClose
public Converter(String outFile) throws FileNotFoundException
outFile
- destinationFileNotFoundException
public Converter(File outFile) throws FileNotFoundException
outFile
- destinationFileNotFoundException
public Converter(OutputStream outStream)
outStream
- destination stream for the conversion resultspublic abstract boolean runConversion()
public void setAutoStreamClose(boolean value)
value
- boolean value of the desired auto-stream close behaviorpublic void closeStream()