From: adam Date: Tue, 28 Dec 2004 10:26:03 +0000 (+0000) Subject: semantically neutral rearrangement to make OpenJava happy X-Git-Url: http://git.megacz.com/?p=org.ibex.io.git;a=commitdiff_plain;h=0a8f7a78d5e62d0353b83c5fb7847d54ca285b3b semantically neutral rearrangement to make OpenJava happy darcs-hash:20041228102603-5007d-70075066b76a9fb2332b19ba8e25636e9761ea56.gz --- diff --git a/src/org/ibex/io/Connection.java b/src/org/ibex/io/Connection.java index a6eda45..b168ae5 100644 --- a/src/org/ibex/io/Connection.java +++ b/src/org/ibex/io/Connection.java @@ -10,13 +10,13 @@ public class Connection extends Stream { private final Socket s; public final String vhost; public Connection(Socket s, String vhost) { super(s); this.vhost = vhost; this.s = s; } - public void close() { try{s.close();}catch(Exception e){throw new StreamException(e);} super.close(); } + public void close() { try{s.close();}catch(Exception e){throw new Stream.StreamException(e);} super.close(); } public int getLocalPort() { return s.getLocalPort(); } public InetAddress getLocalAddress() { return ((InetSocketAddress)s.getLocalSocketAddress()).getAddress(); } public int getRemotePort() { return s.getPort(); } public InetAddress getRemoteAddress() { return ((InetSocketAddress)s.getRemoteSocketAddress()).getAddress(); } public String getRemoteHostname() { return getRemoteAddress().getHostName(); } public String getVirtualHost() { return vhost; } - public void setTimeout(int ms) { try { s.setSoTimeout(ms); } catch (Exception e){throw new StreamException(e); }} - public void setTcpNoDelay(boolean delay) { try { s.setTcpNoDelay(delay);}catch(Exception e){throw new StreamException(e); }} + public void setTimeout(int ms) { try { s.setSoTimeout(ms); } catch (Exception e){throw new Stream.StreamException(e); }} + public void setTcpNoDelay(boolean delay) { try { s.setTcpNoDelay(delay);}catch(Exception e){throw new Stream.StreamException(e); }} } diff --git a/src/org/ibex/io/Stream.java b/src/org/ibex/io/Stream.java index 83a8193..b31c9a6 100644 --- a/src/org/ibex/io/Stream.java +++ b/src/org/ibex/io/Stream.java @@ -246,15 +246,16 @@ public class Stream { } finally { flushing = false; } } - Writer unreader = new OutputStreamWriter(new OutputStream() { - public void close() { } - public void write(int i) throws IOException { byte[] b = new byte[1]; b[0] = (byte)i; write(b, 0, 1); } - public void write(byte[] b) throws IOException { write(b, 0, b.length); } - public void write(byte[] b, int p, int l) { - ensureb2(l); - System.arraycopy(b, p, buf, start-l, l); - start -= l; - } - }); + Writer unreader = new OutputStreamWriter(new InOutputStream()); + private class InOutputStream extends OutputStream { + public void close() { } + public void write(int i) throws IOException { byte[] b = new byte[1]; b[0] = (byte)i; write(b, 0, 1); } + public void write(byte[] b) throws IOException { write(b, 0, b.length); } + public void write(byte[] b, int p, int l) { + ensureb2(l); + System.arraycopy(b, p, buf, start-l, l); + start -= l; + } + } } }