-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
2,132 additions
and
73 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
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
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,35 @@ | ||
package org.brotli.dec; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.lang.reflect.Constructor; | ||
|
||
/** | ||
* Common utility methods. | ||
*/ | ||
public final class TestUtils { | ||
|
||
public static InputStream newBrotliInputStream(InputStream input) throws IOException { | ||
String brotliClass = System.getProperty("BROTLI_INPUT_STREAM"); | ||
if (brotliClass == null) { | ||
return new BrotliInputStream(input); | ||
} | ||
try { | ||
Class<?> clazz = Class.forName(brotliClass); | ||
Constructor<?> ctor = clazz.getConstructor(InputStream.class); | ||
return (InputStream) ctor.newInstance(new Object[] { input }); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
static byte[] readUniBytes(String uniBytes) { | ||
byte[] result = new byte[uniBytes.length()]; | ||
for (int i = 0; i < result.length; ++i) { | ||
result[i] = (byte) uniBytes.charAt(i); | ||
} | ||
return result; | ||
} | ||
|
||
private TestUtils() {} | ||
} |
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,17 @@ | ||
# Description: | ||
# Korlin port of Brotli decoder. | ||
|
||
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
licenses(["notice"]) # MIT | ||
|
||
kt_jvm_library( | ||
name = "dec", | ||
srcs = [ | ||
"BrotliInputStream.kt", | ||
"Decode.kt", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.