byte[] response = new byte[8];  try { connectToProxy();  this.socket.getOutputStream().write(requestPacket, 0, 9 + getUser().length()); this.socket.getInputStream().read(response, 0, 8); }catch(IOException ioe) { throw new ProxyConnectionException(-2, "SOCK4 - IOException: " + ioe.getMessage()); }  return this.socket;
    public void bind(InetSocketAddress isa) throws IOException {        InetAddress addr = isa.getAddress();        byte[] hostbytes = addr.getAddress();        byte[] requestPacket = new byte[300];                requestPacket[0] = 4; // means socks4 (field VN)        requestPacket[1] = 2; // means bind (field CD)        requestPacket[2] = (byte) ( getPrimaryConnectionPort() >> 8 ); // (field DSTPORT)        requestPacket[3] = (byte) ( getPrimaryConnectionPort() & 0x00ff ); // (field DSTPORT)                // adding the host adress bytes to the packet (field DSTIP)        System.arraycopy(hostbytes, 0, requestPacket, 4, 4);                // adding user id to packet (field USERID)        System.arraycopy(getUser().getBytes(), 0, requestPacket, 8, getUser().length());                // terminate the packet        requestPacket[9 + getUser().length()] = 0;    }