Getting the value from an EnumSet in Java
<p>If you use an <code>EnumSet</code> to store conventional binary values (1,2,4 etc), then when there are less than 64 items, I am led to believe that this is stored as a bit vector and is represented efficiently as a long. Is there a simple way to get the value of this long. I want a quick and simple way to store the contents of the set in either a file or database.</p>

<p>If I was doing this the old way, I'd just use a long, and do the bit twidling myself, despite all the issues of typesafety etc.</p>
