package uk.ac.leeds.ccg.dbffile; import java.io.*; import cmp.LEDataStream.*; /** * class to hold infomation about the fields in the file */ public class DbfFieldDef implements DbfConsts{ static final boolean DEBUG=false; public StringBuffer fieldname = new StringBuffer(DBF_NAMELEN); public char fieldtype; public int fieldstart; public int fieldlen; public int fieldnumdec; public DbfFieldDef(){ /* do nothing*/ } public DbfFieldDef(String fieldname,char fieldtype,int fieldlen, int fieldnumdec){ this.fieldname = new StringBuffer(fieldname); this.fieldname.setLength(DBF_NAMELEN); this.fieldtype = fieldtype; this.fieldlen = fieldlen; this.fieldnumdec = fieldnumdec; } public String toString(){ return new String(""+fieldname+" "+fieldtype+" "+fieldlen+ "."+fieldnumdec); } public void setup(int pos, LEDataInputStream dFile) throws IOException { //two byte character modification thanks to Hisaji ONO byte[] strbuf = new byte[DBF_NAMELEN]; // <---- byte array buffer for storing string's byte data int j=-1; int term =-1; for(int i=0;i