搜索功能增强,可直接搜索响应类型和请求方法, 支持brotli编码

This commit is contained in:
wanghongen
2023-07-31 15:32:01 +08:00
parent 8a466dc11a
commit 8e8123f3a8
20 changed files with 473 additions and 99 deletions

View File

@@ -1,5 +1,7 @@
import 'dart:io';
import 'package:brotli/brotli.dart';
///GZIP 解压缩
List<int> gzipDecode(List<int> byteBuffer) {
GZipCodec gzipCodec = GZipCodec();
@@ -11,7 +13,17 @@ List<int> gzipDecode(List<int> byteBuffer) {
}
}
///GZIP 压缩
///GZIP 压缩
List<int> gzipEncode(List<int> input) {
return GZipCodec().encode(input);
}
///br 解压缩
List<int> brDecode(List<int> byteBuffer) {
try {
return brotli.decode(byteBuffer);
} catch (e) {
print("brDecode error: $e");
return byteBuffer;
}
}

View File

@@ -18,3 +18,10 @@ class Strings {
return null;
}
}
class Pair<K, V> {
final K key;
final V value;
Pair(this.key, this.value);
}