projects
/
IRC.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
43e4ed89e6221c7421125215f930a6c9d9aec30f
[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
}