Skip to main content
added 735 characters in body
Source Link
J22o
  • 482
  • 2
  • 4

I am making a COLLADA parser in Java, and I have made a loader that reads a .dae file, and saves it's content in a string. But, when I load a specific file, it doesn't get read correctly. Specifically a line of 3s between two nodes is getting read wrong. Instead of reading in 3s the program reads in spaces. How do I know it is a line of 3s? Well, when I open the file with Notepad++ or Sublime Text 2 it opens fine, but when I open it from Eclpise's Text Editor or load it from my program it reads it wrong. Any reasons why that happens and how to can fix it?

This is my code for loading the file:

BufferedReader reader = new  BufferedReader(new FileReader("src/MAIN/ScondTest.dae"));
StringBuilder builder = new StringBuilder();
String line = reader.readLine();//Ignore the first line: <?xml...
while((line = reader.readLine()) != null) builder.append(line).append(" ");
line = builder.toString().trim().replaceAll("   ", "").replaceAll("  ", "");

This is a link to my file (the line of 3s is at line 228):

https://drive.google.com/open?id=0B_QCd3U4JeWLbmYwSnlzY2ttdEE

This is a small part of the line of 3s(to big to put it all): 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

I am making a COLLADA parser in Java, and I have made a loader that reads a .dae file, and saves it's content in a string. But, when I load a specific file, it doesn't get read correctly. Specifically a line of 3s between two nodes is getting read wrong. Instead of reading in 3s the program reads in spaces. How do I know it is a line of 3s? Well, when I open the file with Notepad++ or Sublime Text 2 it opens fine, but when I open it from Eclpise's Text Editor or load it from my program it reads it wrong. Any reasons why that happens and how to can fix it?

This is my code for loading the file:

BufferedReader reader = new  BufferedReader(new FileReader("src/MAIN/ScondTest.dae"));
StringBuilder builder = new StringBuilder();
String line = reader.readLine();//Ignore the first line: <?xml...
while((line = reader.readLine()) != null) builder.append(line).append(" ");
line = builder.toString().trim().replaceAll("   ", "").replaceAll("  ", "");

This is a link to my file (the line of 3s is at line 228):

https://drive.google.com/open?id=0B_QCd3U4JeWLbmYwSnlzY2ttdEE

I am making a COLLADA parser in Java, and I have made a loader that reads a .dae file, and saves it's content in a string. But, when I load a specific file, it doesn't get read correctly. Specifically a line of 3s between two nodes is getting read wrong. Instead of reading in 3s the program reads in spaces. How do I know it is a line of 3s? Well, when I open the file with Notepad++ or Sublime Text 2 it opens fine, but when I open it from Eclpise's Text Editor or load it from my program it reads it wrong. Any reasons why that happens and how to can fix it?

This is my code for loading the file:

BufferedReader reader = new  BufferedReader(new FileReader("src/MAIN/ScondTest.dae"));
StringBuilder builder = new StringBuilder();
String line = reader.readLine();//Ignore the first line: <?xml...
while((line = reader.readLine()) != null) builder.append(line).append(" ");
line = builder.toString().trim().replaceAll("   ", "").replaceAll("  ", "");

This is a link to my file (the line of 3s is at line 228):

https://drive.google.com/open?id=0B_QCd3U4JeWLbmYwSnlzY2ttdEE

This is a small part of the line of 3s(to big to put it all): 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

Source Link
J22o
  • 482
  • 2
  • 4

Java .dae file loader problem

I am making a COLLADA parser in Java, and I have made a loader that reads a .dae file, and saves it's content in a string. But, when I load a specific file, it doesn't get read correctly. Specifically a line of 3s between two nodes is getting read wrong. Instead of reading in 3s the program reads in spaces. How do I know it is a line of 3s? Well, when I open the file with Notepad++ or Sublime Text 2 it opens fine, but when I open it from Eclpise's Text Editor or load it from my program it reads it wrong. Any reasons why that happens and how to can fix it?

This is my code for loading the file:

BufferedReader reader = new  BufferedReader(new FileReader("src/MAIN/ScondTest.dae"));
StringBuilder builder = new StringBuilder();
String line = reader.readLine();//Ignore the first line: <?xml...
while((line = reader.readLine()) != null) builder.append(line).append(" ");
line = builder.toString().trim().replaceAll("   ", "").replaceAll("  ", "");

This is a link to my file (the line of 3s is at line 228):

https://drive.google.com/open?id=0B_QCd3U4JeWLbmYwSnlzY2ttdEE