Uploaded image for project: 'Commons RNG'
  1. Commons RNG
  2. RNG-10

"save" and "restore" using explicit byte array

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • None
    • 1.0
    • core

    Description

      I think that the current implementation of "save" and "restore" (of the internal state of a RNG) does not gain anything from attempting to hide (using a marker interface) that the state is represented by a byte[] primitive array.

      Moreover, hiding the concrete class (that implements the marker interface and Serializable) in the BaseProvider internal class is also needlessly complicated with no clear benefit.

      I propose to replace the marker interface with a concrete class that wraps a byte[] field with a public accessor method.
      As before, library users do not need to know how the actual state of a RNG is represented by this field, but can directly serialize the byte[] field returned by the getter.

      Attachments

        Activity

          People

            erans Gilles Sadowski
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: