com.aayushatharva.brotli4j:native-windows_x86-64

Brotli4j provides Brotli compression and decompression for Java.

License

License

Categories

Categories

Native Development Tools
GroupId

GroupId

com.aayushatharva.brotli4j
ArtifactId

ArtifactId

native-windows_x86-64
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

Brotli4j provides Brotli compression and decompression for Java.

Download native-windows_x86-64

How to add to project

<!-- https://jarcasting.com/artifacts/com.aayushatharva.brotli4j/native-windows_x86-64/ -->
<dependency>
    <groupId>com.aayushatharva.brotli4j</groupId>
    <artifactId>native-windows_x86-64</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.aayushatharva.brotli4j/native-windows_x86-64/
implementation 'com.aayushatharva.brotli4j:native-windows_x86-64:1.2.2'
// https://jarcasting.com/artifacts/com.aayushatharva.brotli4j/native-windows_x86-64/
implementation ("com.aayushatharva.brotli4j:native-windows_x86-64:1.2.2")
'com.aayushatharva.brotli4j:native-windows_x86-64:jar:1.2.2'
<dependency org="com.aayushatharva.brotli4j" name="native-windows_x86-64" rev="1.2.2">
  <artifact name="native-windows_x86-64" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.aayushatharva.brotli4j', module='native-windows_x86-64', version='1.2.2')
)
libraryDependencies += "com.aayushatharva.brotli4j" % "native-windows_x86-64" % "1.2.2"
[com.aayushatharva.brotli4j/native-windows_x86-64 "1.2.2"]

Dependencies

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.7.0
org.junit.jupiter : junit-jupiter-engine jar 5.7.0

Project Modules

There are no modules declared in this project.

Brotli4j

Brotli4j provides Brotli compression and decompression for Java.

Maven

Maven Central

<dependency>
    <groupId>com.aayushatharva.brotli4j</groupId>
    <artifactId>brotli4j</artifactId>
    <version>1.2.2</version>
</dependency>

Supported Platforms:

Windows 64-Bit
Linux 64-Bit
macOS Catalina 10.15

Loading native library:

Call Brotli4jLoader.ensureAvailability() in your application once before using Brotli4j.

Examples

Direct API

        // Load the native library
        Brotli4jLoader.ensureAvailability();

        // Compress data and get output in byte array
        byte[] compressed = Encoder.compress("Meow".getBytes());

        // Decompress data and get output in DirectDecompress
        DirectDecompress directDecompress = Decoder.decompress(compressed); // or DirectDecompress.decompress(compressed);

        if (directDecompress.getResultStatus() == DecoderJNI.Status.DONE) {
            System.out.println("Decompression Successful: " + new String(directDecompress.getDecompressedData()));
        } else {
            System.out.println("Some Error Occurred While Decompressing");
        }

Compressing a stream:

        // Load the native library
        Brotli4jLoader.ensureAvailability();

        FileInputStream inFile = new FileInputStream(filePath);
        FileOutputStream outFile = new FileOutputStream(filePath + ".br");

        Encoder.Parameters params = new Encoder.Parameters().setQuality(4);
        
        BrotliOutputStream brotliOutputStream = new BrotliOutputStream(outFile, params);

        int read = inFile.read();
        while(read > -1) {
            brotliOutputStream.write(read);
            read = inFile.read();
        }

        // Close the BrotliOutputStream. This also closes the FileOutputStream.
        brotliOutputStream.close();
        inFile.close();

Decompressing a stream:

        // Load the native library
        Brotli4jLoader.ensureAvailability();

        FileInputStream inFile = new FileInputStream(filePath);
        FileOutputStream outFile = new FileOutputStream(decodedfilePath);

        BrotliInputStream brotliInputStream = new BrotliInputStream(inFile);

        int read = brotliInputStream.read();
        while(read > -1) {
            outFile.write(read);
            read = brotliInputStream.read();
        }

        // Close the BrotliInputStream. This also closes the FileInputStream.
        brotliInputStream.close();
        outFile.close();

Sponsors

JProfiler is supporting Brotli4J with its full-featured Java Profiler. JProfiler's intuitive UI helps you resolve performance bottlenecks, pin down memory leaks and understand threading issues. Click below to know more:

File Management

Versions

Version
1.2.2
1.2.1
1.2.0
1.1.0