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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: 6
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: