What is the best way to store a BitSet in App engine? They don't allow 开发者_如何学Cjava.util.BitSet to be a property.
BitSet
is Serializable
. Datastore can get/put Serializable
just fine.
Try EnumSet
"A specialized Set implementation for use with enum types. All of the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created. Enum sets are represented internally as bit vectors. This representation is extremely compact and efficient. The space and time performance of this class should be good enough to allow its use as a high-quality, typesafe alternative to traditional int-based "bit flags." Even bulk operations (such as containsAll and retainAll) should run very quickly if the specified collection is also an enum set."
java.math.BigInteger supports common bit set operations and can be serialized to a byte array.
精彩评论