public class DbaseFileWriter extends Object
DbaseFileHeader header = ...
WritableFileChannel out = new FileOutputStream("thefile.dbf").getChannel();
DbaseFileWriter w = new DbaseFileWriter(header,out);
while ( moreRecords ) {
w.write( getMyRecord() );
}
w.close();
You must supply the moreRecords
and
getMyRecord()
logic...Modifier and Type | Class and Description |
---|---|
static class |
DbaseFileWriter.FieldFormatter
Utility for formatting Dbase fields.
|
Constructor and Description |
---|
DbaseFileWriter(DbaseFileHeader header,
FileChannel out,
boolean isNew)
Create a DbaseFileWriter using the specified header and writing to the
given channel.
|
public DbaseFileWriter(DbaseFileHeader header, FileChannel out, boolean isNew) throws InitializeException
header
- The DbaseFileHeader to write.out
- The Channel to write to.InitializeWriterException
IOException
- If errors occur while initializing.InitializeException
public void append(Feature feature) throws WriteException, UnsupportedEncodingException
record
- The entries to write.UnsupportedEncodingException
WriteException
public void update(Feature feature, long numReg) throws WriteException, UnsupportedEncodingException
record
- The entries to write.WriteException
UnsupportedEncodingException
public void close() throws CloseException
CloseException
IOException
- If errors occur.public void setCharset(Charset charset)