I am testing a part of a bigger program so thats the reason if it looks a bit illogical to structure it this way.The code that I am using is fairly simple but I do not understand why the first half of the lines in the file are completely missing, they not being read at all.
public class Trying {
public static String myReader(){
StringBuilder buf = new StringBuilder();
BufferedReader in = null;
String str = null;
try {
InputStream is = new FileInputStream("c:/themap.txt");
in = new BufferedReader(new InputStreamReader(is));
while ((str = in.readLine()) != null) {
buf.append(str);
//buf.append(System.getProperty("line.separator"));
System.out.println(str);
}
in.close();
}
catch (IOException e) {
e.printStackTrace();
}
return buf.toString();
}
public static void main(String[] args) {
String fmap = myReader();
//System.out.println(fmap);
As you can see I have a basic println in the function just to see what is happening and the first lines are not being shown at all. The rest of the file is being read as it is. Maybe it has to do with the file being 5000 lines long. Any help would be appreciated.
The file's lines look like this
o AE_Cube.014
v 4.996883 0.000000 -0.663325
v 4.996883 0.336000 -0.663325
v 4.490770 0.000000 -1.013470
v 4.490770 0.336000 -1.013470
v 4.990770 0.000000 -1.070477
v 4.990770 0.336000 -1.070477
v 4.589172 0.000000 -1.269103
They are all kind of like this. They don't change in the middle to some other format
The output I get is the same but with the first 1/3 of the file missing.
f 650//652 654//652 653//652
f 649//653 651//653 654//653
f 648//654 649//654 650//654
f 651//655 647//655 648//655
f 652//656 648//656 650//656
f 650//657 649//657 654//657
f 649//658 647//658 651//658
f 648//654 647//654 649//654
o DV_Cube.059
v -1.593174 0.150000 -2.197537
v -1.617969 0.150000 -2.297979
v -1.494583 0.150000 -2.229900
v -1.525588 0.150000 -2.324470
v -1.593001 0.000000 -2.199192
v -1.616714 0.000000 -2.297979
v -1.526114 0.000000 -2.324543
v -1.495018 0.000000 -2.229900