Java slice array as in python

Tags: ,

I have an byte array in Java and need to get parts of it. I wanted to work with Java arrays in the same way as I work with Python list, using slices. There is something similar to this in Java? Thank you in advance.


You can use Arrays’ ( built-in Arrays#copyOfRange()

Arrays.copyOfRange(oldArray, startIndex, endIndex);

Source: stackoverflow