Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java memmove?

Tags:

java

api

I'm in the process of porting some old C code to Java and, due to my inexperience with Java, I have encountered a problem locating a memmove equivalent. Is there such a method in Java? I've done enough research on it to assume that I'm overlooking something rather obvious. Thanks in advance.

like image 915
Gary Chambers Avatar asked Jun 21 '09 02:06

Gary Chambers


1 Answers

You can use System.arraycopy, if all you want to do is shuffle things around in an array.

Specifically, that function permits the source and target to be in the same array, and the ranges are allowed to overlap; so in that sense it's like memmove.

like image 87
Chris Jester-Young Avatar answered Sep 28 '22 02:09

Chris Jester-Young