ЧТо не так все??? Все работает нормально!!
package com.javarush.task.task32.task3210;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
/*
Используем RandomAccessFile
*/
public class Solution {
public static void main(String... args) {
try {
RandomAccessFile raf = new RandomAccessFile(new File(args[0]), "rw");
raf.seek(Integer.parseInt(args[1]));
byte [] bytes = new byte[args[2].length()];
raf.read(bytes, 0,args[2].length());
String str = new String(bytes);
String bool = (args[2].equals(str)) ? "true" : "false";
raf.seek(new File(args[0]).length());
raf.write(bool.getBytes());
raf.close();
} catch (IOException e) {
e.printStackTrace();
}
}
// public static void main(String str1, String st2, String str3) throws IOException {
// File file = new File(str1);
// RandomAccessFile raf = new RandomAccessFile(file, "rw");
// raf.seek(Integer.parseInt(st2));
// byte [] bytes = new byte[str3.length()];
// raf.read(bytes);
// String string = (str3.equals(new String(bytes))) ? "true" : "false";
// raf.seek(file.length());
// raf.write(string.getBytes());
// }
}