com.linuxense.javadbf
Class DBFWriter

java.lang.Object
  |
  +--com.linuxense.javadbf.DBFBase
        |
        +--com.linuxense.javadbf.DBFWriter

public class DBFWriter
extends DBFBase

An object of this class can create a DBF file. Create an object,
then define fields by creating DBFField objects and
add them to the DBFWriter object
add records using the addRecord() method and then
call write() method.


Field Summary
 
Fields inherited from class com.linuxense.javadbf.DBFBase
characterSetName, END_OF_DATA
 
Constructor Summary
DBFWriter()
          Creates an empty Object.
DBFWriter(java.io.File dbfFile)
          Creates a DBFWriter which can append to records to an existing DBF file.
 
Method Summary
 void addRecord(java.lang.Object[] values)
          Add a record.
 void setFields(DBFField[] fields)
          Sets fields.
 void write()
           
 void write(java.io.OutputStream out)
          Writes the set data to the OutputStream.
 
Methods inherited from class com.linuxense.javadbf.DBFBase
getCharactersetName, setCharactersetName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBFWriter

public DBFWriter()
Creates an empty Object.


DBFWriter

public DBFWriter(java.io.File dbfFile)
          throws DBFException
Creates a DBFWriter which can append to records to an existing DBF file.

Throws:
Throws - DBFException if the passed in file does exist but not a valid DBF file, or if an IO error occurs.
DBFException
Method Detail

setFields

public void setFields(DBFField[] fields)
               throws DBFException
Sets fields.

DBFException

addRecord

public void addRecord(java.lang.Object[] values)
               throws DBFException
Add a record.

DBFException

write

public void write(java.io.OutputStream out)
           throws DBFException
Writes the set data to the OutputStream.

DBFException

write

public void write()
           throws DBFException
DBFException