🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #16775

can't catch IOExceptions!!!!

#16775
From: Marcel Hell
Date: Tue, 19 Jan 1999 00:00
34 lines
1521 bytes
    Hi, I have a stupid problem, I suppose!

I want to call the kodiere method, but I get the message:
"unreported exception: java.io.IOException; must be caught or be declared to
be thrown."

But in my opinion, i do as well declare the IOException to be thrown, as
well as I try to catch those!

Could anyone please help me? I add some of my code here:

 void jButton2_actionPerformed(ActionEvent e) {
    String que= textField1.getText();
    String zie= textField2.getText();
    kodiere(que,zie);


}
 public static void kodiere(String quelldatei, String zieldatei) throws
IOException {

 DataInput quelle = new DataInputStream(new FileInputStream(quelldatei));
 DataOutput ziel = new DataOutputStream(new FileOutputStream(zieldatei));
try {
 while(true){
 byte b = (byte) quelle.readByte(); //Einlesen eines Bytes aus der Quelle

 b = (byte) ((b+3)%256);
 ziel.writeByte(b);} }
catch (IOException e) {}
catch (EOFException e) //Dateiende der quelle erreicht.
{System.out.println("Alles klar! Kodierung beendet."); }
}
}
Technical Details
Message-ID: <782105$bbo8@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,986058edfa4b9616,start
X-Google-Attributes: gidf74b3,public
From: "Marcel Hell" <MLP.HELL@student.unimaas.nl>
Subject: can't catch IOExceptions!!!!
Date: 1999/01/19
Message-ID: <782105$bbo8@forums.borland.com>
X-Deja-AN: 434399315
Organization: Another Netscape Collabra Server User
X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.language