![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.code.CompressionBrotli Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.code;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import net.sourceforge.plantuml.FileUtils;
import net.sourceforge.plantuml.brotli.BrotliInputStream;
import net.sourceforge.plantuml.log.Logme;
public class CompressionBrotli implements Compression {
// ::remove file when __CORE__
public byte[] compress(byte[] in) {
throw new UnsupportedOperationException();
}
public ByteArray decompress(byte[] in) throws NoPlantumlCompressionException {
try (final BrotliInputStream brotli = new BrotliInputStream(new ByteArrayInputStream(in));
final ByteArrayOutputStream result = new ByteArrayOutputStream();) {
FileUtils.copyToStream(brotli, result);
return ByteArray.from(result.toByteArray());
} catch (IOException e) {
Logme.error(e);
throw new NoPlantumlCompressionException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy