随笔分类 -  java核心

IO,容器,多线程,网络编程等
摘要:先上代码 public class SingletonTest { // 使用volatile保证可见性 private static volatile SingletonTest singletonTest = null; private SingletonTest() { } public st 阅读全文
posted @ 2021-09-16 23:16 重设代码的天空 阅读(722) 评论(0) 推荐(0)
摘要:package com.albedo.security; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStr 阅读全文
posted @ 2020-09-16 14:58 重设代码的天空 阅读(385) 评论(0) 推荐(0)
摘要:DSA签名 package com.albedo.security; /** * DSA 加解密实现 */ public class DSAUtils extends Base { //字符编码 public static final String ALGORITHM = "DSA"; public 阅读全文
posted @ 2020-09-14 16:46 重设代码的天空 阅读(968) 评论(0) 推荐(0)
摘要:RSA加解密代码: package com.albedo.security; import com.albedo.num.ByteUtils; import javax.crypto.Cipher; import java.security.KeyFactory; import java.secur 阅读全文
posted @ 2020-09-14 16:45 重设代码的天空 阅读(618) 评论(0) 推荐(0)
摘要:package com.albedo.security; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.Sec 阅读全文
posted @ 2020-09-11 15:15 重设代码的天空 阅读(800) 评论(0) 推荐(0)
摘要:package com.albedo.security; import java.math.BigInteger; import java.security.MessageDigest; /** * MD5加密 */ public class Md5Utils { public static Str 阅读全文
posted @ 2020-09-11 15:14 重设代码的天空 阅读(435) 评论(0) 推荐(0)
摘要:package com.albedo.security; import javax.crypto.Cipher; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; import javax.crypt 阅读全文
posted @ 2020-09-11 15:12 重设代码的天空 阅读(556) 评论(0) 推荐(0)
摘要:package com.albedo.security; import javax.crypto.Cipher; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; import javax.crypt 阅读全文
posted @ 2020-09-11 15:11 重设代码的天空 阅读(566) 评论(0) 推荐(0)
摘要:1.异常验证框架 框架1:com.google.common.base.Preconditions 框架2:org.apache.commons.lang.Validate 框架3:org.apache.commons.lang3..Validate 这几个框架大同小异,都是对数据问题进行一定的异常 阅读全文
posted @ 2019-06-12 14:47 重设代码的天空 阅读(1287) 评论(0) 推荐(0)
摘要:转载自:https://www.ibm.com/developerworks/cn/java/j-lo-java8streamapi/index.html 为什么需要 Stream Stream 作为 Java 8 的一大亮点,它与 java.io 包里的 InputStream 和 OutputS 阅读全文
posted @ 2019-03-18 14:09 重设代码的天空 阅读(691) 评论(0) 推荐(0)
摘要:/** *按字节读取文件 */@Testpublic void readerByte() { File file = new File("D:\\BindCheckControllerTest.java"); File fileC = new File("D:\\CopyBindCheckControllerTest.java"); FileInputStream inputS... 阅读全文
posted @ 2018-11-14 10:45 重设代码的天空 阅读(247) 评论(0) 推荐(0)