add methods

This commit is contained in:
Looly 2021-07-11 18:07:56 +08:00
parent fa324608b2
commit 06e136f311
3 changed files with 30 additions and 1 deletions

View File

@ -23,6 +23,7 @@
* 【setting】 修复Props中Charset对象无法序列化的问题pr#1694@Github
* 【db 】 修复PageResult首页判断逻辑问题issue#1699@Github
* 【core 】 修复IdcardUtil可能数组越界问题pr#1702@Github
* 【core 】 修复FastByteArrayOutputStream索引越界问题issue#I402ZP@Github
-------------------------------------------------------------------------------------------------------------

View File

@ -1602,6 +1602,18 @@ public class CollUtil {
return null == enumeration || false == enumeration.hasMoreElements();
}
/**
* Map是否为空
*
* @param map 集合
* @return 是否为空
* @see MapUtil#isEmpty(Map)
* @since 5.7.4
*/
public static boolean isEmpty(Map<?, ?> map) {
return MapUtil.isEmpty(map);
}
// ---------------------------------------------------------------------- isNotEmpty
/**
@ -1658,6 +1670,18 @@ public class CollUtil {
return IterUtil.hasNull(iterable);
}
/**
* Map是否为非空
*
* @param map 集合
* @return 是否为非空
* @see MapUtil#isNotEmpty(Map)
* @since 5.7.4
*/
public static boolean isNotEmpty(Map<?, ?> map) {
return MapUtil.isNotEmpty(map);
}
// ---------------------------------------------------------------------- zip
/**

View File

@ -68,6 +68,10 @@ public class FastByteArrayOutputStream extends OutputStream {
*/
public void writeTo(OutputStream out) throws IORuntimeException {
final int index = buffer.index();
if(index < 0){
// 无数据写出
return;
}
byte[] buf;
try {
for (int i = 0; i < index; i++) {