title: how to cast enum to byte array in Java?
body: <p>I want to cast an Enum value to a byte array in Java, I found the following post on StackOverflow:</p>
  
  <p><a href="https://stackoverflow.com/questions/21108509/how-to-cast-enum-to-byte-array">How to cast enum to byte array?</a></p>
  
  <p>However, it was not helpful.</p>
  
  <p>I want to iterate over all the Elements of the enum and cast them to a byte array or to cast the whole enum once. </p>