1package eu.siacs.conversations.xml;
2
3import com.google.common.io.ByteSource;
4
5import java.io.IOException;
6import java.io.InputStream;
7
8public class XmlElementReader {
9
10 public static Element read(byte[] bytes) throws IOException {
11 return read(ByteSource.wrap(bytes).openStream());
12 }
13
14 public static Element read(InputStream inputStream) throws IOException {
15 final XmlReader xmlReader = new XmlReader();
16 xmlReader.setInputStream(inputStream);
17 return xmlReader.readElement(xmlReader.readTag());
18 }
19
20}