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

存储与CDN>对象存储 COS>上传异常 #5

Open
zl25321 opened this issue Jul 13, 2017 · 0 comments
Open

存储与CDN>对象存储 COS>上传异常 #5

zl25321 opened this issue Jul 13, 2017 · 0 comments

Comments

@zl25321
Copy link

zl25321 commented Jul 13, 2017

/**
* 读取指定流从某处开始的内容,此函数有一定的风险,如果流对应的内容过大,则会造成OOM
*
* @param inputStream
* @param offset 读取的开始偏移
* @param length 读取的长度
* @return 读取的内容
* @throws Exception
*/
public static String getFileContent(InputStream inputStream, long offset, int length)
throws Exception {
byte[] fileContent = getFileContentByte(inputStream, offset, length);
return new String(fileContent, Charset.forName("ISO-8859-1"));
}
你们这个方法大文件会导致内存溢出,没有其他的处理方式?

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