*/
public static Object[][] getDBFData(File dbfFile, String[] fieldNames) throws IOException
{
List<String> allFields = getAttributeNames(dbfFile);
FileInputStream fis = new FileInputStream(dbfFile);
DbaseFileReader dbfReader = new DbaseFileReader(fis.getChannel(), false, Charset.forName("ISO-8859-1"));
//contains the header columns
DbaseFileHeader dbfHeader = dbfReader.getHeader();
List<Object[]> rowsList = new Vector<Object[]>();
while(dbfReader.hasNext())
{
Object[] row;
if (fieldNames != null)
{
dbfReader.read();
row = new Object[fieldNames.length];
for (int i = 0; i < fieldNames.length; i++)
{
int index = allFields.indexOf(fieldNames[i]);
if (index < 0)
row[i] = "";
else
row[i] = dbfReader.readField(index);
}
}
else
{
row = dbfReader.readEntry();
}
rowsList.add(row);
}