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

(bf) ByteBuffer needs System.arraycopy()/bcopy()/memmove()- like behaviors (EASE OF USE)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 6
    • core-libs
    • unknown
    • generic

      the java.nio.ByteBuffer API has no analagous method(s) to System.arraycopy(),
      or bcopy()/memmove() on UNIX(tm) systems.

      Although it is possible to effect the same behavior using the same API, it
      is onerous and is likely to incur programmer error ... (the workaround
      requires the use of position(), limit(), slice() and bulk get()/put())

      The addition of two methods:

      static void <copy>(ByteBuffer src, ByteBuffer, dst, int len);

      and (more importantly):

      static void <copy>(ByteBuffer src, int srcPos, ByteBuffer dst, int dstPos, int len);

      would greatly improve the situation.

      note: copies/moves between direct and non-direct buffers is required

      note: an IncompatibleByteOrderException should be thrown if the byte orders
            of the dst and src do not match ...
      ###@###.### 10/6/04 16:27 GMT

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: