/** * Load a recommender engine from an input stream. * <p> * <strong>Note:</strong> this method is only capable of auto-detecting gzip-compressed data. * If the {@linkplain #setCompressionMode(CompressionMode) compression mode} is {@link CompressionMode#AUTO}, * only gzip-compressed streams are supported. Set the compression mode manually if you are * using XZ compression. * </p> * * @param stream The input stream. * @return The deserialized recommender. * @throws IOException if there is an error reading the input data. * @throws RecommenderConfigurationException * if there is a configuration error with the deserialized recommender or * the configurations applied to it. */ public LenskitRecommenderEngine load(@WillClose InputStream stream) throws IOException, RecommenderConfigurationException { InputStream decomp; if (compressionMode == CompressionMode.AUTO) { decomp = LKFileUtils.transparentlyDecompress(stream); } else { decomp = compressionMode.wrapInput(stream); } return loadInternal(decomp); }
LKFileUtils.transparentlyDecompress(stream), classLoader); try { ClassLoaderContext ctx = null;
/** * Load a recommender engine from an input stream. * <p> * <strong>Note:</strong> this method is only capable of auto-detecting gzip-compressed data. * If the {@linkplain #setCompressionMode(CompressionMode) compression mode} is {@link CompressionMode#AUTO}, * only gzip-compressed streams are supported. Set the compression mode manually if you are * using XZ compression. * </p> * * @param stream The input stream. * @return The deserialized recommender. * @throws IOException if there is an error reading the input data. * @throws RecommenderConfigurationException * if there is a configuration error with the deserialized recommender or * the configurations applied to it. */ public LenskitRecommenderEngine load(@WillClose InputStream stream) throws IOException, RecommenderConfigurationException { InputStream decomp; if (compressionMode == CompressionMode.AUTO) { decomp = LKFileUtils.transparentlyDecompress(stream); } else { decomp = compressionMode.wrapInput(stream); } return loadInternal(decomp); }
LKFileUtils.transparentlyDecompress(stream), classLoader); try { ClassLoaderContext ctx = null;