niepok

Untitled

Nov 9th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. public class XMLClient {
  2. public static void main(String[] args) throws IOException, ClassNotFoundException, UnknownHostException {
  3.        
  4.         if (args.length != 2) {
  5.             System.err.println(
  6.                 "Usage: java EchoClient <host name> <port number>");
  7.             System.exit(1);
  8.         }
  9.  
  10.         String hostName = args[0];
  11.         int portNumber = Integer.parseInt(args[1]);
  12.         Socket kkSocket = new Socket(hostName, portNumber);
  13.         ObjectInputStream fromServer = new ObjectInputStream(kkSocket.getInputStream());
  14.         XStream in_xml = new XStream();
  15.         String xml_graph = (String)fromServer.readObject();
  16.        
  17.         /*
  18.         FileWriter plik = null;
  19.         plik = new FileWriter("graf.txt");
  20.         PrintWriter zapis = new PrintWriter(plik);
  21.         zapis.println(xml_graph);
  22.         zapis.close();
  23.         */
  24.         //System.out.println(xml_graph);
  25.         int[][] tab = (int[][])in_xml.fromXML(xml_graph);
  26.  
  27.     //dalej kod do algorytmów
  28. }
Advertisement
Add Comment
Please, Sign In to add comment