Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public static Document construirDocumento(File xml) throws FileNotFoundException, IOException, JDOMException {
  2.         SAXBuilder builder = new SAXBuilder();
  3.         FileInputStream fis = new FileInputStream(xml);
  4.         byte[] data = new byte[(int) xml.length()];
  5.         fis.read(data);
  6.         fis.close();
  7.         ByteArrayInputStream bais = new ByteArrayInputStream(new String(data).getBytes("UTF-8"));
  8.         Document docXML = builder.build(bais);
  9.         bais.close();
  10.         return docXML;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement