title: Is it possible to use struct-like constructs in Java?
body: <p>I'm considering using Java for a large project but I haven't been able to find anything that remotely represented structures in Java. I need to be able to convert network packets to structures/classes that can be used in the application.</p>
  
  <p>I know that it is possible to use <code>RandomAccessFile</code> but this way is <strong>NOT</strong> acceptable. So I'm curious if it is possible to "cast" a set of bytes to a structure like I could do in C. If this is not possible then I cannot use Java.</p>
  
  <p>So the question I'm asking is if it is possible to cast aligned data to a class without any extra effort beyond specifying the alignment and data types?</p>