writer.write(new Object[] { "004", "long word of unknow catalog fruit" });
writer.close();
fos.close();
InputStream inputStream = new FileInputStream(dbfile);
DBFReader reader = new DBFReader(inputStream);
reader.setCharactersetName("gbk");
int numberOfFields = reader.getFieldCount();
assertEquals(2, numberOfFields);
DBFField field0 = reader.getField(0);
assertEquals("code", field0.getName());
DBFField field1 = reader.getField(1);
assertEquals("name", field1.getName());
Object[] rowObjects;
while ((rowObjects = reader.nextRecord()) != null) {
for (int i = 0; i < rowObjects.length; i++) {
System.out.println(rowObjects[i]);
}