-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
isayan
committed
Jul 16, 2024
1 parent
9221e5e
commit 685c024
Showing
8 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true | ||
release_version_major=3.1 | ||
release_version_minor=0.2 | ||
release_version_minor=1.0 | ||
netbeans.license=mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package extend.util.external; | ||
|
||
import static extension.helpers.ConvertUtil.compressZlib; | ||
import static extension.helpers.ConvertUtil.toBase64Encode; | ||
import extension.helpers.StringUtil; | ||
import java.io.BufferedOutputStream; | ||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.charset.Charset; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.zip.Deflater; | ||
import java.util.zip.GZIPInputStream; | ||
import org.brotli.dec.BrotliInputStream; | ||
|
||
/** | ||
* | ||
* @author isayan | ||
*/ | ||
public class BrotliUtil { | ||
|
||
public static byte[] decompressBrotli(byte[] content) throws IOException { | ||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
try (BrotliInputStream btis = new BrotliInputStream(new ByteArrayInputStream(content))) { | ||
try (BufferedOutputStream out = new BufferedOutputStream(baos)) { | ||
byte[] buf = new byte[1024]; | ||
int size; | ||
while ((size = btis.read(buf, 0, buf.length)) != -1) { | ||
out.write(buf, 0, size); | ||
} | ||
out.flush(); | ||
} | ||
} | ||
return baos.toByteArray(); | ||
} | ||
|
||
} |