/** * Creates a new {@code AtomEntry} instance based on a given stream. * A few endpoints, such as {@code search/jobs/{sid}}, * return an Atom {@code <entry>} element as the root of the response. * * @param input The input stream. * @return An {@code AtomEntry} instance representing the parsed stream. */ public static AtomEntry parseStream(InputStream input) { XMLStreamReader reader = createReader(input); AtomEntry result = AtomEntry.parse(reader); try { reader.close(); } catch (XMLStreamException e) { throw new RuntimeException(e.getMessage(), e); } return result; }