Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

读取特殊格式的InputStream导致阻塞 #3846

Open
wuliaoqiecaicai opened this issue Jan 15, 2025 · 0 comments
Open

读取特殊格式的InputStream导致阻塞 #3846

wuliaoqiecaicai opened this issue Jan 15, 2025 · 0 comments

Comments

@wuliaoqiecaicai
Copy link

版本情况

JDK版本: orcaljdk_8_202
hutool版本: 5.8.35(请确保最新尝试是否还有问题)

问题描述(包括截图)

使用IoUtil的public static byte[] readBytes(InputStream in, boolean isClose) throws IORuntimeException读取流的时候,如果输入流最后输入的为0时,会导致整个方法阻塞20秒左右,将读取方法修改为InputStream的read方法后正常,不再阻塞。

复现代码

byte[] bytes = IoUtil.readBytes(inputStream, false);

测试涉及到的文件(注意脱密)

输入流内容如下

f1f5eafa000a0000828974000800680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Image

比如报错的Excel文件,有问题的图片等。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant