@@ -0,0 +1,1279 @@
+package nanomsg;%0A%0Aimport java.nio.charset.Charset;%0Aimport com.sun.jna.Pointer;%0Aimport com.sun.jna.ptr.PointerByReference;%0Aimport nanomsg.jna.NanoMsg;%0A%0A%0Apublic abstract class RWSocket extends Socket %7B%0A    public RWSocket(int domain, int protocol) %7B%0A        super(domain, protocol);%0A    %7D%0A%0A    public void sendString(String data) %7B%0A        Charset encoding = Charset.forName(%22UTF-8%22);%0A        this.sendBytes(data.getBytes(encoding));%0A    %7D%0A%0A    public void sendBytes(byte%5B%5D data) %7B%0A        int rc = NanoMsg.nn_send(this.socket, data, data.length, 0);%0A        if (rc %3C 0) %7B%0A            System.out.println(%22Error%22);%0A        %7D%0A    %7D%0A%0A    public String recvString() throws RuntimeException %7B%0A        byte%5B%5D received = this.recvBytes();%0A        Charset encoding = Charset.forName(%22UTF-8%22);%0A%0A        return new String(received, encoding);%0A    %7D%0A%0A    public byte%5B%5D recvBytes() throws RuntimeException %7B%0A        Pointer buff = Pointer.NULL;%0A        PointerByReference ptrBuff = new PointerByReference(buff);%0A%0A        int received = NanoMsg.nn_recv(this.socket, ptrBuff, Constants.NN_MSG, 0);%0A        if (received %3C 0) %7B%0A            throw new RuntimeException(%22error on rcv%22);%0A        %7D%0A%0A        Pointer result = ptrBuff.getValue();%0A        return result.getByteArray(0, received);%0A    %7D%0A%7D%0A

Add RWSocket class.