1f0f32c0570e7eaf8bb35cccfbde6ff080fdb536
[IRC.git] / Robust / src / ClassLibrary / Socket.java
1 public class Socket {
2     /* Data pending flag */
3     flag IOPending;    
4     /* File Descriptor */
5     int fd;
6     
7     Socket() {
8     }
9     
10     int setFD(int filed) {
11         fd=filed;
12     }
13
14     public int read(byte[] b) {
15         return nativeRead(b, fd);
16     }
17     public void write(byte[] b) {
18         nativeWrite(b, fd);
19     }
20
21     private native static int nativeRead(byte[] b, int fd);
22     private native static void nativeWrite(byte[] b, int fd);
23     private native static void nativeClose(int fd);
24
25     public void close() {
26         nativeClose(fd);
27     }
28 }