Class DbaseFile

java.lang.Object
org.gvsig.fmap.dal.store.dbf.utils.DbaseFile
All Implemented Interfaces:
Closeable, AutoCloseable

public class DbaseFile extends Object implements Closeable
Class to read and write data to a dbase III format file. Creation date: (5/15/2001 5:15:13 PM)
  • Field Details

  • Constructor Details

    • DbaseFile

      public DbaseFile(File afile)
    • DbaseFile

      public DbaseFile(File afile, Charset chars)
    • DbaseFile

      public DbaseFile(File afile, Charset chars, boolean allowDuplicatedFieldNames)
  • Method Details

    • getHeader

      public DbaseFileHeader getHeader()
    • getCodePageInt

      public int getCodePageInt()
    • getCharsetName

      public String getCharsetName()
      Returns the charset used to read/write this dbf. Maybe different from the declared in the file if we have forced a different one
    • getOriginalCharsetName

      public String getOriginalCharsetName()
      Returns the charset declared on the dbf file (or the default one if none is declared)
    • getRecordCount

      public int getRecordCount()
    • getFieldCount

      public int getFieldCount()
    • getBooleanFieldValue

      public boolean getBooleanFieldValue(long rowIndex, int fieldId)
    • getBytesFieldValue

      public byte[] getBytesFieldValue(long rowIndex, int fieldId) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException
      Throws:
      org.gvsig.fmap.dal.exception.UnsupportedEncodingException
    • getStringFieldValue

      public String getStringFieldValue(long rowIndex, int fieldId) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException
      Throws:
      org.gvsig.fmap.dal.exception.UnsupportedEncodingException
    • setFieldValue

      public void setFieldValue(long rowIndex, int fieldId, Object obj) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException, org.gvsig.fmap.dal.exception.WriteException
      Throws:
      org.gvsig.fmap.dal.exception.UnsupportedEncodingException
      org.gvsig.fmap.dal.exception.WriteException
    • open

      public void open() throws org.gvsig.fmap.dal.exception.FileNotFoundException, org.gvsig.fmap.dal.exception.UnsupportedVersionException, IOException, org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeNotSuportedException
      read the DBF file into memory.
      Throws:
      org.gvsig.fmap.dal.exception.FileNotFoundException
      org.gvsig.fmap.dal.exception.UnsupportedVersionException
      IOException
      org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeNotSuportedException
    • close

      public void close() throws IOException
      Removes all data from the dataset
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getWriteChannel

      public FileChannel getWriteChannel()
    • isOpen

      public boolean isOpen()
    • getFieldIndex

      public int getFieldIndex(String name)
    • getCurrenCharset

      public Charset getCurrenCharset()
    • getOriginalCharset

      public Charset getOriginalCharset()
    • setCharset

      public void setCharset(Charset chars)
    • isWritable

      public boolean isWritable()