Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5037068

BitSet bulk import/export

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 1.4.2
    • core-libs
    • b17
    • x86
    • windows_xp
    • Not verified

        Name: jl125535 Date: 04/23/2004


        A DESCRIPTION OF THE REQUEST :
        BitSet does not currently provide any means of setting/getting the bits from external data, the most basic of which is a byte array, which is how the bits would be stored externally (via any from of stream or file).


        JUSTIFICATION :
        In order to fill up a BitSet with any sort of existing external data, the user must do the bit manipulation outside of the BitSet and then set the bits one by one. Other than efficiency degradation of a method call per bit, the whole point of a BitSet is to encapsulate bit-wise operations so the user doesn't have to deal with shifting, oring and anding bits one by one!

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The BitSet should have some type of import/export methods to support at least the basic binary storage unit of a byte array, so that the bits can be initialized from and saved into external storage without requiring external bitwise operations - the BitSet should be doing the bitwise operations.to
        Possible options are a byte array constructor, a toByteArray() method, a addByte() method, or something of the sort.

        (note that the problem of the bitset boundary within a byte array can be resolved externally using the known bitset length).
        (Incident Review ID: 255294)
        ======================================================================

              martin Martin Buchholz
              jleesunw Jon Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: