Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2509

Clean up ByteBufferUtil

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.5.1, 1.6.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Right now we rely on o.a.a.core.util.ByteBufferUtil to handle translating to/from byte[]. So long as we're not refactoring things to use ByteBuffer across the code base, this utility needs to be cleaned up.

      The current implementation is lacking in a few ways:

      • it presumes the backing array is accessible
      • it doesn't state the above in javadocs
      • it uses the entire backing array instead of the part marked as valid
      • it doesn't use the ByteBuffer optimized bulk getter methods

      Preferably, it would do so by changing to allow for any ByteBuffer and it would use the ByteBuffer.get method to copy into a byte[] to be returned. We'll need tests to make sure current code isn't relying on the incorrect ignoring of buffer boundaries.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              busbey Sean Busbey
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: