public class Main
{
public static void main()
{
java.io.FileInputStream fileDBF = File.OpenRead("example.dat");
byte[] data = new byte[32];
int amountRead = fileDBF.read(data, 0, 32);
if (amountRead != 32)
{
System.out.println("Error!!!");
}
else
{
size = data[8] + data[9] * 256;
int numberFields = size / 32 - 1;
for (int i = 0; i < numberFields; i++)
{
amountRead = fileDBF.read(data, 0, 32);
String nameField = "";
for (int j = 0; j < 11; j++)
{
nameField += (char)data[j];
}
System.out.printf("Name: %1$s" + "\r\n", nameField);
}
fileDBF.close();
}
}
}