1

The file is created by following codes:

    Point Data = {0};           //Point is a  C++ structer 
    PointFile cPointFile;       // file class

    // Fill data structure(buffer) with Point Data, for file access.

    this->Serialize(&Data);
    bool bRet = cPointFile.SaveFile();

how to use java read the file?

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
  • possible duplicate of [Android read text raw resource file](http://stackoverflow.com/questions/4087674/android-read-text-raw-resource-file) – Chaosit Jul 09 '15 at 09:57

1 Answers1

0

No, the file is not "created by following codes".

The file is obviously created by a class method class saveFile().

You failed to show the implementation of the safeFile() method, which actually implements saving of whatever it's saving to a file.

How exactly the data is saved into the file is implemented entirely within this mysterious saveFile() method.

And without knowing exactly what saveFile() do, it is impossible to answer this question.

Sam Varshavchik
  • 114,536
  • 5
  • 94
  • 148
  • The key code of saveFile() is write(m_iFileDes, pBuffer, len);But this isn't quite the point: the point is how to read C++ struct file by JAVA – lidongsheng Jul 10 '15 at 02:45
  • The same way you read any other file in Java. There's nothing different about a file that's written by a C program from a file that's written by anything else. There's nothing magical about a file that was written by a C program. You open it, and read it. That's it. – Sam Varshavchik Jul 10 '15 at 12:17