How to read .DAT file in java
807589Aug 26 2008 — edited Aug 26 2008Hello,
My code to read .DAT file gave me incorrect result. My .DAT file is having record with three columns (zip, latitude, longitude). When I read this .DAT file in DELPHI, giving correct result but not in java.
I have given my java code below,
File f = new File("c:/ZipTile.dat");
FileInputStream file_input = new FileInputStream (f);
DataInputStream data_in = new DataInputStream (file_input );
while (true) {
try {
System.out.println" Zip5 " + data_in.readInt() + " lat " + data_in.readInt() + " lon " + data_in.readInt());
} catch (EOFException eof) {
System.out.println ("End of File");
break;
}
}