How can I 'cut' byte array using Arrays.copyOfRange
with long parameters?
EDIT: I need to cut file ( not larger than 2GB ) from byte index to the end of file ( byte[].length )
int size = f.length()
throws: incompatible types: possible lossy conversion from long to int (even if the file is 600kB)
File f = new File("path-to-file");
byte[] bytes = Files.readAllBytes( f.toPath() );
long indexToCutFrom = a_long_number;
long indexToCutTo = f.length() - 1;
// method with these parameters does not exists
byte[] cuttedBytes = Arrays.copyOfRange( bytes, indexToCutFrom, indexToCutTo );