I’ve been asked to “write a file to disk in a format that is easily readable by other applications. There is no requirement for the file to be human readable”. The data to be written to file is a combination of integer, string and date variables.
I can’t quite figure out what the aim of this question is and what the correct answer should be.
What are the core considerations to be made in order to write a file to disk in a format that is easily readable by other applications (using the simplest possible method).
No this is not homework.
This is a pretty vague requirement. If the other applications also written in Java, then Java serialization may be the best approach.
EDIT: @leftbrain — In answer to your comment, I think I would lean toward XML; it was designed to support basic interoperability among applications. The three kinds of data mentioned (integer, string, and date) can generally be represented exactly with no special tricks and there is good support for XML processing across most programming languages. However, each data type (in the abstract) can present challenges. I would have asked the following: