mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add methods
This commit is contained in:
parent
fa324608b2
commit
06e136f311
@ -23,6 +23,7 @@
|
|||||||
* 【setting】 修复Props中Charset对象无法序列化的问题(pr#1694@Github)
|
* 【setting】 修复Props中Charset对象无法序列化的问题(pr#1694@Github)
|
||||||
* 【db 】 修复PageResult首页判断逻辑问题(issue#1699@Github)
|
* 【db 】 修复PageResult首页判断逻辑问题(issue#1699@Github)
|
||||||
* 【core 】 修复IdcardUtil可能数组越界问题(pr#1702@Github)
|
* 【core 】 修复IdcardUtil可能数组越界问题(pr#1702@Github)
|
||||||
|
* 【core 】 修复FastByteArrayOutputStream索引越界问题(issue#I402ZP@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -1602,6 +1602,18 @@ public class CollUtil {
|
|||||||
return null == enumeration || false == enumeration.hasMoreElements();
|
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
|
// ---------------------------------------------------------------------- isNotEmpty
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1658,6 +1670,18 @@ public class CollUtil {
|
|||||||
return IterUtil.hasNull(iterable);
|
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
|
// ---------------------------------------------------------------------- zip
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,6 +68,10 @@ public class FastByteArrayOutputStream extends OutputStream {
|
|||||||
*/
|
*/
|
||||||
public void writeTo(OutputStream out) throws IORuntimeException {
|
public void writeTo(OutputStream out) throws IORuntimeException {
|
||||||
final int index = buffer.index();
|
final int index = buffer.index();
|
||||||
|
if(index < 0){
|
||||||
|
// 无数据写出
|
||||||
|
return;
|
||||||
|
}
|
||||||
byte[] buf;
|
byte[] buf;
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < index; i++) {
|
for (int i = 0; i < index; i++) {
|
||||||
@ -113,4 +117,4 @@ public class FastByteArrayOutputStream extends OutputStream {
|
|||||||
ObjectUtil.defaultIfNull(charset, CharsetUtil.defaultCharset()));
|
ObjectUtil.defaultIfNull(charset, CharsetUtil.defaultCharset()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user