/** * Read the given {@link InputStream} and parse its data into a new {@link JavaUnit} instance of the given type. The * caller is responsible for closing the stream. */ public static JavaUnit parseUnit(final InputStream data) { return parseUnit(Streams.toString(data)); }
/** * Read the given {@link InputStream} and parse its data into a new {@link JavaUnit} instance of the given type. The * caller is responsible for closing the stream. * * @param data the stream to read from * @return a new {@link JavaUnit} instance of the given type * @throws ParserException if no parser is capable of parsing the provided data * @throws IllegalStateException if no parser is available in the classPath */ public static JavaUnit parseUnit(final InputStream data) { return parseUnit(Streams.toString(data)); }