diff --git a/src/main/java/vip/xumy/core/pojo/com/PageResponse.java b/src/main/java/vip/xumy/core/pojo/com/PageResponse.java index fdfe825..c79dd03 100644 --- a/src/main/java/vip/xumy/core/pojo/com/PageResponse.java +++ b/src/main/java/vip/xumy/core/pojo/com/PageResponse.java @@ -14,6 +14,5 @@ import lombok.Setter; @Getter public class PageResponse{ private List rows; // 每页记录集合 - private String status; private Long total; } \ No newline at end of file diff --git a/src/main/java/vip/xumy/core/utils/FileUtil.java b/src/main/java/vip/xumy/core/utils/FileUtil.java index a61019d..d902e84 100644 --- a/src/main/java/vip/xumy/core/utils/FileUtil.java +++ b/src/main/java/vip/xumy/core/utils/FileUtil.java @@ -71,6 +71,29 @@ public class FileUtil { } return null; } + + public static byte[] read(InputStream is) { + byte[] body = null; + try{ + byte[] buf = new byte[20480]; + int len = -1; + while ((len = is.read(buf)) != -1) { + if(body == null) { + body = new byte[len]; + System.arraycopy(buf, 0, body, 0, len); + }else { + byte[] tmp = body; + body = new byte[len + tmp.length]; + System.arraycopy(tmp, 0, body, 0, tmp.length); + System.arraycopy(buf, 0, body, tmp.length, len); + } + } + return body; + } catch (IOException e) { + log.error("Read file error.", e); + } + return null; + } /** * Read file and return content in string;