If you use an EnumSet
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.
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.