> setAllOnes() to set all bits true, maybe use BitSet.set(int fromIndex, int toIndex) with fromIndex=0 and toIndex=BitSet.size()
> firstOne() to find the first true bit, maybe use BitSet.nextSetBit(0) > writeToDataOutputStream() BitSet is already Serializable. But maybe you need to reimplement it to keep compatability to the current serialization code. > hashCode() isn't this implemented already in BitSet.hashCode() ? On 7/23/07, Alberto Bacchelli <sback at sback.it> wrote: > I surveyed BitArray class to check whether it is possible to delete it > in favor of BitSet. > > IMHO we could dismiss BitArray, but we should extend the existing > java.util.BitSet class to provide some methods missing: > setAllOnes() to set all bits true, > firstOne() to find the first true bit, > writeToDataOutputStream() > hashCode() > unsignedByte() [STATIC method] > I don't think it would be difficult to create them. > > On the other hand, maybe it could be knotty to substitute > serializedLength() method which has only one reference. > > Matthew Toseland wrote: > > On Thursday 12 July 2007 13:19, bbackde at googlemail.com wrote: > > > >> Slightly off topic question: why don't you use the existing > >> java.util.BitSet? This seems to work for me in Frost. > >> > > > > IIRC we needed some extra methods. Somebody should check into this. > > > >> On 7/12/07, Sback <sback at sback.it> wrote: > >> > [CUT] > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > -- __________________________________________________ GnuPG key: (0x48DBFA8A) Keyserver: pgpkeys.pca.dfn.de Fingerprint: 477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A __________________________________________________
