Java programmeerimise konspekt
System.out.println ("S/V viga: " + e);
}
.....
//===================================================================
====
// Filtrid
//===================================================================
====
class Rot13InputStream extends FilterInputStream {
Rot13InputStream (InputStream i) {
super (i);
}
public int read() throws IOException {
return rot13 (in.read()); // in on isendimuutuja
}
static int rot13 (int c) { // sama kasutame ka po"o"rdteisenduseks
if ((c >= 'A') && (c <= 'Z'))
c = 'A' + (((c - 'A') + 13) % 26);
if ((c >= 'a') && (c <= 'z'))
c = 'a' + (((c - 'a') + 13) % 26);
return c;
}
} // Rot13InputStream lopp
//===================================================================
=
class Rot13OutputStream extends FilterOutputStream {
Rot13OutputStream (OutputStream o) {
super (o);
}
public void write (int c) throws IOException {
out.write (Rot13InputStream