title: Are there any Java Frameworks for binary file parsing?
body: <p>My problem is, that I want to parse binary files of different types with a generic parser which is implemented in JAVA. Maybe describing the file format with a configuration file which is read by the parser or creating Java classes which parse the files according to some sort of parsing rules.</p>
  
  <p>I have searched quite a bit on the internet but found almost nothing on this topic.</p>
  
  <p>What I have found are just things which deal with compiler-generators (Jay, Cojen, etc.) but I don't think that I can use them to generate something for parsing binary files. But I could be wrong on that assumption.</p>
  
  <p>Are there any frameworks which deal especially with easy parsing of binary files or can anyone give me a hint how I could use parser/compiler-generators to do so?</p>
  
  <p><strong>Update</strong>:
  I'm looking for something where I can write a config-file like</p>
  
  <pre><code>file:
    header: FIXED("MAGIC")
    body: content(10)
  
  content:
    value1: BYTE
    value2: LONG
    value3: STRING(10)
  </code></pre>
  
  <p>and it generates automatically something which parses files which start with "MAGIC", followed by ten times the content-package (which itself consists of a byte, a long and a 10-byte string).</p>
  
  <p><strong>Update2</strong>:
  I found something comparable what I'm looking for, "<a href="http://construct.wikispaces.com/" rel="nofollow noreferrer">Construct</a>", but sadly this is a Python-Framework. Maybe this helps someone to get an idea, what I'm looking for.</p>