| | |
| | | package com.ruoyi.utils.tools; |
| | | |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Field; |
| | | import java.text.DecimalFormat; |
| | | import java.time.LocalTime; |
| | |
| | | int digitGroups = (int) (Math.log10(size) / Math.log10(1024)); |
| | | return new DecimalFormat("#,###.##").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups]; |
| | | } |
| | | |
| | | /** |
| | | * byte数组转字符串 |
| | | * 刘苏义 |
| | | * 2023/10/18 8:42:59 |
| | | * @param byteArray |
| | | */ |
| | | public static String byteArrayToString(byte[] byteArray) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (byte b : byteArray) { |
| | | stringBuilder.append(String.valueOf(b)); |
| | | } |
| | | return stringBuilder.toString(); |
| | | } |
| | | } |