🧁release 5.7.5

This commit is contained in:
Looly
2021-07-18 23:57:48 +08:00
parent 21b06f83a0
commit d8f393f7d9
24 changed files with 23 additions and 41 deletions

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.7.5-SNAPSHOT</version>
<version>5.7.5</version>
</parent>
<artifactId>hutool-core</artifactId>

View File

@@ -82,25 +82,6 @@ public class CharsetDetector {
return null;
}
/**
* 判断编码,判断后会关闭流
*
* @param in 流
* @param charset 编码
* @return 编码
*/
private static Charset detectCharset(InputStream in, Charset charset) throws IOException {
CharsetDecoder decoder = charset.newDecoder();
final byte[] buffer = new byte[512];
while (in.read(buffer) > -1) {
if (identify(buffer, decoder)) {
return charset;
}
}
return null;
}
/**
* 通过try的方式测试指定bytes是否可以被解码从而判断是否为指定编码
*