Čau.
Uprostřed programu potřebuji zkopírovat soubor a zamotal jsem se do konstruktoru try-catch-finally.
Respektive mi to u bloku finally píše: unreported exception IOException, must be caught or declared to be thrown.
Jak to mám upravit aby to šlapalo? Díkes
InputStream in = null;
OutputStream out = null;
try {
in = new FileInputStream("C:\\fileA.mdb");
out = new FileOutputStream("C:\\fileB.mdb");
byte[] buffer = new byte[1024];
int numRead;
while ((numRead = in.read(buffer)) != -1) {
out.write(buffer, 0, numRead);
}
} catch (IOException e) {
} finally {
in.close();
out.close();
}