public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { return xml.fromXML(Strings2.toStringAndClose(stream), type); } finally { if (stream != null) { stream.close(); } } }
public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { return xml.fromXML(Strings2.toStringAndClose(stream), type); } finally { if (stream != null) { stream.close(); } } }
public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { return xml.fromXML(Strings2.toStringAndClose(stream), type); } finally { if (stream != null) { stream.close(); } } }
public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { return xml.fromXML(Strings2.toStringAndClose(stream), type); } finally { if (stream != null) { stream.close(); } } }
public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { return xml.fromXML(Strings2.toStringAndClose(stream), type); } finally { if (stream != null) { stream.close(); } } }
public <V> V apply(final InputStream stream, final Class<V> type) throws IOException { try { String str = Strings2.toStringAndClose(stream); return xml.fromXML(str, type); } finally { if (stream != null) { stream.close(); } } }
@Test public void testJAXBParserBOM() throws Exception { String input = "\uFEFF<test><elem>foo</elem></test>"; TestJAXBDomain obj = xml.fromXML(input, TestJAXBDomain.class); assertThat(obj.getElem()).isEqualTo("foo"); }