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

Generalize MemorySegment::ofBuffer

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 19
    • None
    • core-libs
    • None
    • b24

    Description

      MemorySegment::ofBuffer can be used to create a memory segment out of a byte buffer. It could be sometimes useful to create a memory segment out of other kinds of buffer instances, e.g. an IntBuffer. This can be done by altering the parameter of the ofBuffer factory, from ByteBuffer to just Buffer.

      For the reverse direction (segment to buffer) we have two options:

      * just leave `asByteBuffer`. Users can generally convert a byte buffer into other buffer views using the `asXYZBuffer` methods.

      * add overloads for different buffer kinds, accepting different value layouts.

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: