public void sendCommand(String command) {

        outputBuffer.setLength(0);

        try
        {
            out.writeBytes(command + "\n");
            out.flush();
//            try{Thread.sleep(100);}catch(Exception ee){}

//            InputStreamReader isr = new InputStreamReader(in);
//            BufferedReader br = new BufferedReader(isr);
//            System.out.println(br.readLine());

            byte[] tmp = new byte[1024];
            boolean rdy = false;
            while(true){
                while(in.available()>0){
                    rdy = true;
                    int i=in.read(tmp, 0, 1024);
                    if(i<0)break;
                    outputBuffer.append(new String(tmp, 0, i));
                }
                try{Thread.sleep(200);}catch(Exception ee){}
                if (rdy && in.available()<=0) {
                    break;
                }
            }
        }

        catch(IOException ioX)
        {
            logWarning(ioX.getMessage());
        }
    }