Parsing Binary Files


Reading formatted binary files can be a real chore. A typical approach is to translate the file format into a sequence of read() calls for each primitive data type and build up an object that represents the file in a logical manner. This works, but it's very tedious and error prone. In this article, a simple, effective parser for reading Java class files is demonstrated. The parser uses a grammar defined by Java classes.

Read the full article on Webservices Summit