Skip to content

Instantly share code, notes, and snippets.

@openrijal
Created May 1, 2013 12:21
Show Gist options
  • Save openrijal/5495005 to your computer and use it in GitHub Desktop.
Save openrijal/5495005 to your computer and use it in GitHub Desktop.
Implementation of Arrays.copyOfRange() in terms of System.arraycopy() for compatibility in older Android versions.
public byte[] copyOfRange(byte[] from, int start, int end){
int length = end - start;
byte[] result = new byte[length];
System.arraycopy(from, start, result, 0, length);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment