daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest May 17th, 2018 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String xml = "<?xml version="1.0" standalone="yes"?><root></root>"
  2.    
  3. String xml = "<root></root>
  4.    
  5. try (Socket socket = server.accept()) {
  6.     try (InputStream in = socket.getInputStream()) {
  7.         final Scanner scanner = new Scanner(new InputStreamReader(in, "UTF-8"));
  8.         scanner.useDelimiter("<\?xml.*?\?>");  //Stop stream read when XMl tag is found
  9.     }
  10. }
RAW Paste Data
Top