diff --git a/CHANGELOG.md b/CHANGELOG.md index a2370a837..fe5be9e2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * 【http 】 HttpRequest.form方法判断集合增强(pr#381@Gitee) * 【core 】 NumberUtil增加calculate方法 * 【core 】 优化TextSimilarity.longestCommonSubstring性能(issue#I42A6V@Gitee) +* 【core 】 MultipartRequestInputStream改为使用long以支持大文件(issue#I428AN@Gitee) ### 🐞Bug修复 * 【core 】 修复RobotUtil双击右键问题(pr#1721@Github) diff --git a/hutool-core/src/main/java/cn/hutool/core/net/multipart/MultipartRequestInputStream.java b/hutool-core/src/main/java/cn/hutool/core/net/multipart/MultipartRequestInputStream.java index 03ae1bca2..008a6197c 100644 --- a/hutool-core/src/main/java/cn/hutool/core/net/multipart/MultipartRequestInputStream.java +++ b/hutool-core/src/main/java/cn/hutool/core/net/multipart/MultipartRequestInputStream.java @@ -41,7 +41,7 @@ public class MultipartRequestInputStream extends BufferedInputStream { * @param i 跳过的byte数 * @throws IOException IO异常 */ - public void skipBytes(int i) throws IOException { + public void skipBytes(long i) throws IOException { long len = super.skip(i); if (len != i) { throw new IOException("Unable to skip data in HTTP request"); @@ -165,8 +165,8 @@ public class MultipartRequestInputStream extends BufferedInputStream { * @return 复制的字节数 * @throws IOException 读取异常 */ - public int copy(OutputStream out) throws IOException { - int count = 0; + public long copy(OutputStream out) throws IOException { + long count = 0; while (true) { byte b = readByte(); if (isBoundary(b)) { @@ -186,8 +186,8 @@ public class MultipartRequestInputStream extends BufferedInputStream { * @return 复制的字节数 * @throws IOException 读取异常 */ - public int copy(OutputStream out, long limit) throws IOException { - int count = 0; + public long copy(OutputStream out, long limit) throws IOException { + long count = 0; while (true) { byte b = readByte(); if (isBoundary(b)) { @@ -208,8 +208,8 @@ public class MultipartRequestInputStream extends BufferedInputStream { * @return 跳过的字节数 * @throws IOException 读取异常 */ - public int skipToBoundary() throws IOException { - int count = 0; + public long skipToBoundary() throws IOException { + long count = 0; while (true) { byte b = readByte(); count++;