title: Attempt at parsing packets: Is there a Java equivalent to Python's "unpack"?
body: <p>Is there an equivalent function to this Python function in Java?</p>
  
  <p><a href="http://docs.python.org/library/struct.html" rel="nofollow">struct.unpack(fmt, string)</a></p>
  
  <p>I'm trying to port a parser written in Python to Java, and I'm looking for a way to implement the following line of code:</p>
  
  <pre><code>handle, msgVer, source, startTime, dataFormat, sampleCount, sampleInterval, physDim,  digMin, digMax, physMin,  physMax,  freq, = unpack(self.headerFormat,self.unprocessed[pos:pos+calcsize(self.headerFormat)])
  </code></pre>
  
  <p>I'm using this in the context of a project where I receive bytes from the network and need to extract a specific part of the bytes to display them.</p>
  
  <p>[EDIT 2]</p>
  
  <p>The conclusion I had posted as an update was wrong.  I deleted it to avoid misleading others.</p>