8 public Socket(String host, int port) {
9 InetAddress address=InetAddress.getByName(host);
10 fd=nativeBind(address.getAddress(), port);
11 nativeConnect(fd, address.getAddress(), port);
14 public Socket(InetAddress address, int port) {
15 fd=nativeBind(address.getAddress(), port);
16 nativeConnect(fd, address.getAddress(), port);
19 public static native int nativeBind(byte[] address, int port);
21 public static native int nativeConnect(int fd, byte[] address, int port);
23 int setFD(int filed) {
27 public int read(byte[] b) {
30 public void write(byte[] b) {
34 private native int nativeRead(byte[] b);
35 private native void nativeWrite(byte[] b);
36 private native void nativeClose();