Foreword:
I understand that this is a very popular topic and there are several forums online that try to detail what one would do to create custom binaries for game data. However, I have come to the conclusion that most of the answers are out of context or misleading. So please try to provide answers that are intuitive and lead to an end result rather than answers that simply explain something without a followable example. Also, please try to refrain from making suggestions to other solutions, lets try to stick with custom binary file formats and keep things straight forward :D
Description:
I as a game programmer, currently is working on version 2 of a prototype engine that curates knowledge from myself and others with great experience. For this particular version I aim to tackle some of the bad implementations that make my engine inflexible. One such implementation is the misuse of Java's serialization and Serializable. After reading chapter 12 of Effective Java Third Edition by Joshua Bosch, I came to a conclusion that there must be a way for me to properly organize and protect my game resources such that they are easily accessible, difficult to tamper with, easily independently updateable and perhaps efficient. Research has brought me to custom binary file formats which I am interested in for the java platform.
I would like to better understand:
- How I can define a custom format with Java code as an example
- How I can convert my data in to a file that uses this format and back with Java
- What should I watch out for