In article <op.t9sgahlx8jd0ej@petes-computer.local>,
"Peter Duniho" <NpOeStPeAdM@nnowslpianmk.com> wrote:
On Thu, 17 Apr 2008 20:57:33 -0700, Lew <lew@lewscanon.com> wrote:
[...]
You use System.arraycopy(), as others have suggested, when you're using
a target array that you need to allocate outside the call.
I understand that. But part of a well-designed API is discoverability. A
natural place to look for that functionality is in the classes involved,
as opposed to a general purpose utility class (especially considering that
that utility class consists mostly of things related to the run-time
environment, rather than management of data within a Java program).
The arraycopy() method, to me, seems like an anomaly in the System class,
whereas it would seem quite at home as a static method in either the Array
or Arrays class.
YMMV.
Pete
The System and Runtime classes are an odd collection of things that
needed a home in the Java 1.0 days. That was back when Java was supposed
to be a compact, super efficient language for browsers and embedded
devices. (Yes, the flaws in that logic were visible back then too.)
Which explains why Arrays didn't include the method. It was already in the
API, so they didn't duplicate it.
doesn't even follow Sun's own naming conventions).