import java.io.*;public class Patch{ public static void main(String[] args) { try { File fileIn = new File("C:\\test.exe"); InputStream streamIn = new FileInputStream(fileIn); BufferedInputStream bufferIn = new BufferedInputStream(streamIn); File fileOut = new File("C:\\Ergebnis.exe"); OutputStream streamOut = new FileOutputStream(fileOut); BufferedOutputStream bufferOut = new BufferedOutputStream(streamOut); byte[] byteBuffer = new byte[1024*10]; int i; while ((i = bufferIn.read(byteBuffer)) != -1) { exchangeBytes(byteBuffer); bufferOut.write(byteBuffer); } } catch (FileNotFoundException ex) { ex.printStackTrace(); System.exit(1); } catch (IOException ex) { ex.printStackTrace(); System.exit(2); } } private static void exchangeBytes(byte[] aBuffer) { //Hier die fehlerhaften Bytes ermitteln und austauschen }}