test/java/nio/channels/Selector/ByteServer.java

Print this page

        

@@ -65,10 +65,14 @@
         if (s == null)
             throw new IllegalStateException("no connection");
         s.getOutputStream().write(new byte[count]);
     }
 
+    int read(byte[] buffer) throws IOException {
+        return s.getInputStream().read(buffer);
+    }
+
     public void close() throws IOException {
         if (s != null)
             s.close();
         ss.close();
     }