
Util工具类
Coffee-84
这个作者很懒,什么都没留下…
展开
-
生成32位字符串ID工具类UUIDUtil
public class UUIDUtils { public static String getUUID() { String s = UUID.randomUUID().toString(); return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18) + s.substring(19, 23) + s....原创 2018-12-29 10:24:31 · 1635 阅读 · 0 评论 -
读配置文件取配置参数工具类PropertiesUtil
public class PropertiesUtil { private static Properties properties = new Properties(); static { InputStream in = PropertiesUtil.class.getResourceAsStream("/config.properties"); try { prope...原创 2018-12-29 10:26:43 · 494 阅读 · 0 评论 -
压缩图片工具类ZipImageUtil
四个常量配置参数可以按需求做相应调整。 public class ZipImageUtil { private final static int FILE_SIZE_LIMIT = 100 * 1024; private final static int STREAM_SIZE_LIMIT = 100 * 1024; private final static do...原创 2018-12-29 10:32:41 · 418 阅读 · 0 评论 -
雪花算法生成长整型ID工具类SnowflakeUtil
JS语言不支持15位以上的长整型,该工具使用与否要有取舍。 public class SnowflakeUtil { /** 开始时间截 (2015-01-01) */ private final static long TWEPOCH = 1420041600000L; /** 工作机器ID(0~31) */ private final static long WORKER_I...原创 2018-12-29 10:42:52 · 4865 阅读 · 1 评论