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

(bf) NewDirectByteBuffer always has order ByteOrder.BIG_ENDIAN

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P5
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      This is an update to the JNI specification to match longstanding behavior so should not present any compatibility issues.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Change NewDirectByteBuffer JNI specification to match that of java.nio.ByteBuffer.allocateDirect() and its longstanding behavior.

      Problem

      NewDirectByteBuffer does not specify that the direct ByteBuffer object it constructs has byte order java.nio.ByteOrder.BIG_ENDIAN.

      Solution

      Update the NewDirectByteBuffer JNI specification verbiage.

      Specification

      --- a/closed/src/java.se/share/specs/jni/functions.md
      +++ b/closed/src/java.se/share/specs/jni/functions.md
      @@ -3610,10 +3610,12 @@
      
       `jobject NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity);`
      
       Allocates and returns a direct `java.nio.ByteBuffer` referring to the block of
       memory starting at the memory address `address` and extending `capacity` bytes.
      +The byte order of the returned buffer is always big-endian (high byte first; 
      +`java.nio.ByteOrder.BIG_ENDIAN`).
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
              Reviewed By:
              Alan Bateman, Brent Christian, Lance Andersen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: