semantically neutral rearrangement to make OpenJava happy
authoradam <adam@megacz.com>
Tue, 28 Dec 2004 10:26:03 +0000 (10:26 +0000)
committeradam <adam@megacz.com>
Tue, 28 Dec 2004 10:26:03 +0000 (10:26 +0000)
darcs-hash:20041228102603-5007d-70075066b76a9fb2332b19ba8e25636e9761ea56.gz

src/org/ibex/io/Connection.java
src/org/ibex/io/Stream.java

index a6eda45..b168ae5 100644 (file)
@@ -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); }}
 }
index 83a8193..b31c9a6 100644 (file)
@@ -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;
+           }
+       }
     }
 }