start of new file
[IRC.git] / Robust / src / ClassLibrary / SocketInputStream.java
1 public class SocketInputStream extends InputStream {
2     Socket s;
3     public SocketInputStream(Socket s) {
4         this.s=s;
5     }
6
7     public int read() {
8         byte[] x=new byte[1];
9         int len=s.read(x);
10         if (len<=0)
11             return -1;
12         else return x[0];
13     }
14
15     public int read(byte[] b) {
16         return s.read(b);
17     }
18
19     public void close() {
20         s.close();
21     }
22 }