Class DbaseFileWriter

java.lang.Object
org.gvsig.fmap.dal.store.dbf.utils.DbaseFileWriter

public class DbaseFileWriter extends Object
A DbaseFileReader is used to read a dbase III format file. The general use of this class is:
 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...
Author:
Ian Schneider
  • Constructor Details

    • DbaseFileWriter

      public DbaseFileWriter(DbaseFileHeader header, FileChannel out, boolean isNew) throws org.gvsig.fmap.dal.exception.InitializeException
      Create a DbaseFileWriter using the specified header and writing to the given channel.
      Parameters:
      header - The DbaseFileHeader to write.
      out - The Channel to write to.
      Throws:
      org.gvsig.fmap.dal.exception.InitializeException
  • Method Details

    • append

      public void append(org.gvsig.fmap.dal.feature.Feature feature) throws org.gvsig.fmap.dal.exception.WriteException, org.gvsig.fmap.dal.exception.UnsupportedEncodingException
      Write a single dbase record.
      Throws:
      org.gvsig.fmap.dal.exception.WriteException
      org.gvsig.fmap.dal.exception.UnsupportedEncodingException
    • update

      public void update(org.gvsig.fmap.dal.feature.Feature feature, long numReg) throws org.gvsig.fmap.dal.exception.WriteException, org.gvsig.fmap.dal.exception.UnsupportedEncodingException
      Write a single dbase record. Useful to update a dbf.
      Throws:
      org.gvsig.fmap.dal.exception.WriteException
      org.gvsig.fmap.dal.exception.UnsupportedEncodingException
    • close

      public void close() throws org.gvsig.fmap.dal.exception.CloseException
      Release resources associated with this writer. Highly recommended
      Throws:
      org.gvsig.fmap.dal.exception.CloseException
    • setCharset

      public void setCharset(Charset charset)
    • getLogger

      protected org.gvsig.tools.logger.FilteredLogger getLogger()