public String  RecieveMessages(){
            byte[] data = null;

                try   {      
                  int length = inputStream.read();
                   data       = new byte[length];
                         length     = 0;
                          if (length != data.length)
                                 {
                                 int ch = inputStream.read(data,0, data.length);
                                      if (ch == -1)
                                     {
                                           throw new IOException("Can't read data");
                                         }
                         }
                
               }
                catch (IOException e)
            {
                    System.err.println(e);
            }
                catch (NegativeArraySizeException xd){
                     System.err.println(xd);
                }
                catch (Exception err){
                    System.err.println("Entro a este final catch.");
                }
                                              String x= new String(data);
                                                                      return x;
                                        
        }