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 Java?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might try
System.arraycopyor make use of array functions in theArraysclass likejava.util.Arrays.copyOf. Both should give you native performance under the hood.Arrays.copyOf is probably favourable for readability, but was only introduced in java 1.6.