Error in DbfInputStream ?!

From: Gubler, Rüdiger <rgubler@init-ka.de>
Date: Tue Oct 08 2002 - 06:28:16 EDT

Hello,

while opening the attached file i get the following exception:

java.lang.NumberFormatException: empty String
        at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:989)
        at java.lang.Double.valueOf(Double.java:168)
        at java.lang.Double.<init>(Double.java:240)
        at com.bbn.openmap.dataAccess.shape.input.DbfInputStream.readData(Unknown Source)
        at com.bbn.openmap.dataAccess.shape.input.DbfInputStream.<init>(Unknown Source)
        at test.MainTest.main(MainTest.java:23)

My code:

import java.io.FileInputStream;
import java.util.Iterator;
import java.util.List;

import com.bbn.openmap.dataAccess.shape.input.DbfInputStream;

public class MainTest
{

  public static void main(String[] args)
  {
    FileInputStream fis;
    DbfInputStream dbfIS;
    List dataList, dataRow;
    Iterator it, it2;
    String[] columnNames;

    try
    {
      fis = new FileInputStream( "C:/test.dbf" );
      dbfIS = new DbfInputStream( fis );

      dataList = dbfIS.getRecords();

      columnNames = dbfIS.getColumnNames();

      for( int ii = 0; ii < columnNames.length; ii++ )
      {
        System.err.print( columnNames[ii] + (ii < columnNames.length - 1 ? ", " : "\n") );
      }

      it = dataList.iterator();
      while( it.hasNext() )
      {
        dataRow = (List)it.next();

        it2 = dataRow.iterator();
        while( it2.hasNext() )
        {
          System.err.print( it2.next() + (it2.hasNext() ? ", " : "\n") );
        }

      }

    }
    catch( Exception ex )
    {
      ex.printStackTrace();
    }

  }

}

 

Yours Ruediger

 <<tgr36001lkA.dbf>>

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Oct 8 06:30:51 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT