public class DBFWriter extends DBFBase implements Closeable
DEFAULT_CHARSET, END_OF_DATA
Constructor and Description |
---|
DBFWriter()
Deprecated.
|
DBFWriter(Charset charset)
Deprecated.
|
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.
|
DBFWriter(OutputStream out)
Creates a DBFWriter wich write data to the given OutputStream.
|
DBFWriter(OutputStream out,
Charset charset)
Creates a DBFWriter wich write data to the given OutputStream.
|
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
|
protected RandomAccessFile |
getRamdonAccessFile()
Get de underlying RandomAccessFile.
|
protected boolean |
isClosed()
Check if the writer is closed
|
void |
setFields(DBFField[] fields)
Sets fields definition.
|
void |
write()
Deprecated.
use
close() |
void |
write(OutputStream out)
Deprecated.
use
DBFWriter(OutputStream) constructor and call close |
getCharactersetName, getCharset, setCharactersetName, setCharset
@Deprecated public DBFWriter()
DBFWriter(OutputStream)
@Deprecated public DBFWriter(Charset charset)
DBFWriter(OutputStream, Charset)
charset
- Charset used to encode field names and field contentspublic DBFWriter(OutputStream out)
out
- stream to write the data to.public DBFWriter(OutputStream out, Charset charset)
out
- stream to write the data to.charset
- Encoding to use in resulting dbf filepublic DBFWriter(File dbfFile)
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)
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)
fields
- fields definitionpublic void addRecord(Object[] values)
values
- fields of the recordpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
protected boolean isClosed()
protected RandomAccessFile getRamdonAccessFile()
@Deprecated public void write(OutputStream out)
DBFWriter(OutputStream)
constructor and call closeout
- the output stream@Deprecated public void write()
close()
Copyright © 2024. All rights reserved.