Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class XMLClient {
- public static void main(String[] args) throws IOException, ClassNotFoundException, UnknownHostException {
- if (args.length != 2) {
- System.err.println(
- "Usage: java EchoClient <host name> <port number>");
- System.exit(1);
- }
- String hostName = args[0];
- int portNumber = Integer.parseInt(args[1]);
- Socket kkSocket = new Socket(hostName, portNumber);
- ObjectInputStream fromServer = new ObjectInputStream(kkSocket.getInputStream());
- XStream in_xml = new XStream();
- String xml_graph = (String)fromServer.readObject();
- /*
- FileWriter plik = null;
- plik = new FileWriter("graf.txt");
- PrintWriter zapis = new PrintWriter(plik);
- zapis.println(xml_graph);
- zapis.close();
- */
- //System.out.println(xml_graph);
- int[][] tab = (int[][])in_xml.fromXML(xml_graph);
- //dalej kod do algorytmów
- }
Advertisement
Add Comment
Please, Sign In to add comment