Is there an equivalent to memcpy() in Java?

前端 未结 9 1822
灰色年华
灰色年华 2020-12-25 09:34

I have a byte[] and would like to copy it into another byte[]. Maybe I am showing my simple \'C\' background here, but is there an equivalent to memcpy() on byte arrays in

9条回答
  •  盖世英雄少女心
    2020-12-25 09:45

    You can use System.arrayCopy. It copies elements from a source array to a destination array. The Sun implementation uses hand-optimized assembler, so this is fast.

提交回复
热议问题