Constructor and Description |
---|
FileCodeData(Config config)
Create a new
FileCodeData with the given configuration. |
Modifier and Type | Method and Description |
---|---|
InputStream |
getInput()
Create a new
FileInputStream for the input file given in the configuration. |
OutputStream |
getOutput()
Create a new
FileOutputStream for writing the csv output file. |
OutputStream |
getOutputForIdent(CodeType type,
EncodingConfig format,
String ident,
String suffix)
Create a new
FileOutputStream for writing a barcode. |
public FileCodeData(Config config)
Create a new FileCodeData
with the given configuration.
config
- the configuration (files and folders) to use for the input and output data.public InputStream getInput() throws IOException
Create a new FileInputStream
for the input file given in the configuration. The InputStream
must
be closed by the caller.
getInput
in interface CodeData
FileInputStream
for reading the input data.IOException
- if the creation of the FileInputStream
fails.public OutputStream getOutput() throws IOException
Create a new FileOutputStream
for writing the csv output file. If the folder for the output file does not
exists then it will be created.
getOutput
in interface CodeData
FileOutputStream
for writing the csv data.IOException
- if the creation of the FileOutputStream
or the folder fails.public OutputStream getOutputForIdent(CodeType type, EncodingConfig format, String ident, String suffix) throws IOException
Create a new FileOutputStream
for writing a barcode. If the folder for the output file does not exists
then it will be created.
This method may be called from different threads as long as the parameters are different.
getOutputForIdent
in interface CodeData
type
- the type to write.format
- the encoding format to write.ident
- the ident of the data.suffix
- the suffix of the file to write.FileOutputStream
for writing the barcode data.IOException
- if the creation of the FileOutputStream
or the folder fails.Copyright © 2020 sw4j.org. All rights reserved.