JDK-4124549 : RFE: Java equiv. of memory functions memcmp,set,cpy().
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.1.5
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-04-01
  • Updated: 1998-07-21
  • Resolved: 1998-07-21
Description
Problem
-------

Low level data manipulation
===========================

Cust>  A number of low level data manipulation issues have surfaced
Cust>   e.g. returning a sub-array from a packed byte array - it is
Cust>   necessary to create a new sub-array which is an expensive
Cust>   operation and requires much more coding effort than
Cust>   previously required. 
Cust> 
Cust>   Is there a more efficient or simpler solution to that
Cust>   outlined above? For example, an ArrayRef class that returned
Cust>   an immutable Array interface?
Cust> 
Cust> The point of my issue is that I am not aware that Java provides any
Cust> functions in order to perform the required operations. As I stated in my
Cust> submission, what we want to do is "return a sub-array from a packed byte
Cust> array without having to create a new array".
Cust> 
Cust> System.arraycopy() is not enough. Without a java equivalent of the
Cust> memory functions memcmp() and memset() it is very hard to write
Cust> efficient low-level data manipulation methods.
Cust> 
Cust> For example, working with a particular byte[], it might take 2ms to 
Cust> copy the values from one array to another. However to initialise the
Cust> array would require a java for or while loop which takes 50 times longer
Cust> to execute!


Code Example
------------

The is no code example for this RFE.

To Reproduce
------------

There is no reproducable for this RFE.

Expectations
------------

This RFE is aimed to provide Java authors with methods that can
optimize application performance.

Comments
EVALUATION In JDK1.2 Beta4, we've added the equivalent of memset, with "subarray support", under the name of Arrays.fill. (The current implementation does not use native methods, but the FCS implementation will.) I believe that this is sufficient to handle the customer's needs. (Memcmp is still missing though we do provide partial support with Arrays.equals.) joshua.bloch@Eng 1998-07-21 Any chance of a public version of this Eval...
21-07-1998