This occurs when the file is being locked by another application. Check if another process is accessing the same file. On Windows follow this post to figure it out :
If it's being used, terminate that process to gain access.
java.io.IOException: Invalid argument at java.io.FileInputStream.read0(Native Method) at java.io.FileInputStream.read(FileInputStream.java:207) at undefined.Test.main(Test.java:7)