public class DBFWriter extends DBFBase implements Closeable
DEFAULT_CHARSET, END_OF_DATA
Constructor and Description |
---|
DBFWriter()
Creates an empty DBFWriter.
|
DBFWriter(Charset charset)
Creates an empty DBFWriter.
|
DBFWriter(File dbfFile)
Creates a DBFWriter which can append to records to an existing DBF file.
|
DBFWriter(File dbfFile,
Charset charset)
Creates a DBFWriter which can append to records to an existing DBF file.
|
Modifier and Type | Method and Description |
---|---|
void |
addRecord(Object[] values)
Add a record.
|
void |
close()
In sync mode, write the header and close the file
|
void |
setCharset(Charset charset)
Sets the charset to use to read and write files.
|
void |
setFields(DBFField[] fields)
Sets fields.
|
void |
write()
Deprecated.
use
close() |
void |
write(OutputStream out)
Writes the set data to the OutputStream.
|
getCharactersetName, getCharset, setCharactersetName
public DBFWriter()
public DBFWriter(Charset charset)
charset
- Charset used to encode field names and field contentspublic DBFWriter(File dbfFile) throws DBFException
dbfFile
- The file passed in shouls be a valid DBF file.DBFException
- if the passed in file does exist but not a valid DBF file,
or if an IO error occurs.public DBFWriter(File dbfFile, Charset charset) throws DBFException
dbfFile
- The file passed in shouls be a valid DBF file.charset
- The charset used to encode field name and field contentsDBFException
- if the passed in file does exist but not a valid DBF file,
or if an IO error occurs.public void setFields(DBFField[] fields) throws DBFException
DBFException
public void addRecord(Object[] values) throws DBFException
DBFException
public void write(OutputStream out) throws DBFException
DBFException
public void close() throws DBFException
close
in interface Closeable
close
in interface AutoCloseable
DBFException
@Deprecated public void write() throws DBFException
close()
DBFException
public void setCharset(Charset charset)
DBFBase
setCharset
in class DBFBase
Copyright © 2020. All rights reserved.