I doubt it.

From the javadoc of System.arraycopy:

Otherwise, if any of the following is true, an ArrayStoreException is thrown and the destination is not modified:
  • The src argument and dest argument refer to arrays whose component types are different primitive types.

Robert


Michael Bauroth <[EMAIL PROTECTED]>

13/04/2006 10:12
Please respond to mina-dev

       
        To:        [email protected]
        cc:        
        Subject:        Re: converting ASCII represented longs from ByteBuffer to simple data type?



[EMAIL PROTECTED] wrote:

>             for (int i = 0; i < stringChars.length; i++)
>             {
>                 stringChars[i] = (char) stringBytes[i];
>             }

What about replacement of loop with

System.arraycopy(stringBytes, 0, stringChars, 0, stringChars.length);

Would it work?

Regards
Michael



This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

Reply via email to