Java
Adventure1995
这个作者很懒,什么都没留下…
展开
-
BufferedWriter, BufferedReader
private static void test3() { try { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:\\Users\\Win10\\Documents\\WeChat Files\\wxid_h3y9nlkycvw122\\FileStorage\\File\\2021-01\\WINP.原创 2021-02-22 13:07:54 · 164 阅读 · 0 评论 -
FileInputStream, FileReader, InputStreamReader
1) File file = new File ("hello.txt"); FileInputStream in=new FileInputStream(file); 2) File file = new File ("hello.txt"); FileInputStream in=new FileInputStream(file); InputStreamReader inReader=new InputStreamReader(in); BufferedReader bufReader..原创 2021-02-22 09:41:13 · 139 阅读 · 0 评论 -
PropertiesFile Singleton Design Method
package com.winter.demo.quartz.utils;import com.winter.demo.quartz.service.ReturnFont;import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import java.util.Map;import java.util.Properties;public class PropertiesFile { .原创 2021-02-20 15:56:18 · 77 阅读 · 0 评论 -
MD5
package io.renren.rest.tool;import org.apache.commons.codec.binary.Hex;import org.apache.commons.lang.StringUtils;import java.nio.charset.StandardCharsets;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;/** * MD5.原创 2021-02-18 20:45:45 · 105 阅读 · 0 评论 -
Identity Cards
package io.renren.common.utils;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.Random;public class IDCards { public static void main(String[] args) { S.原创 2021-02-04 12:01:12 · 11236 阅读 · 0 评论 -
HTTP _The Old Way
//java 发送post 请求的json数据 public static String post(String strURL, String params) { System.out.println(strURL); System.out.println(params); BufferedReader reader = null; try { URL url = new URL(strURL);// ...原创 2021-01-24 17:04:21 · 79 阅读 · 0 评论 -
Add Fonts To JVM__Trial One
vi /etc/fonts/font.conf<dir>/usr/local/java/jdk1.8.0-211/jre/lib/fonts/fallback</dir>原创 2021-01-22 13:47:27 · 111 阅读 · 0 评论 -
So It Goes__How To Package jar Files
jar cvfM0 springcloud-zuul.jar * // 压缩当前目前所有文件到.jarjar cvfM0 spring-zuul.jar E:/springcloud-zuul/ // 指定压缩目录原创 2021-01-21 17:55:47 · 64 阅读 · 0 评论 -
Install Java On CentOS__Version 2
1, Check whether java has already been installed:java -version2, Install the Oracle JDK:Download the JDK from the following link:Java 8 From Oracle3, Check the downloaded .tar.gz file:4, UncompressMake a new directory for installation:原创 2021-01-21 16:45:36 · 125 阅读 · 0 评论 -
AESUtil
package com.sf.test.encryption;import javax.crypto.*;import javax.crypto.spec.SecretKeySpec;import java.nio.charset.StandardCharsets;import java.security.InvalidKeyException;import java.security.NoSuchAlgorithmException;import java.security.SecureR.原创 2021-01-21 11:08:06 · 164 阅读 · 1 评论 -
Padding in RSA
padding值给弄对,加密的bytes上限117,但是有空的话回加上padding,所以加密吹来的字符串其实不止是117;要满足2的7次方,才是一个完整的block。输入的bytes,加密后的长度其实不止是117;其实一个block的size应该是128。解密的时候要把block的size要传对。package com.winplan365.othink.rest.tool;import com.fasterxml.jackson.databind.ObjectMapper;import co原创 2021-01-20 18:00:37 · 144 阅读 · 0 评论 -
Insertion Sort
package com.sf.test.test;public class Sort { public static void insertionSort(int[] arr) { for (int i = 1; i < arr.length; i++) { int tmp = arr[i]; for (int j = i - 1; j >= 0; j--) { if (j ==.原创 2021-01-20 12:10:42 · 137 阅读 · 0 评论 -
Unmei Is Just A Brief Hanabi
package com.sf.test.test;public class Hanyou { public Hanyou() { } private static class Unmei { private static Hanyou hanyou = new Hanyou(); } public static Hanyou getInstance() { return Unmei.hanyou; } pu.原创 2021-01-20 11:28:37 · 76 阅读 · 0 评论 -
Singleton
package com.sf.test.test;public class Hanabi { private static Hanabi hanabi; private Hanabi() { } public static Hanabi getInstance() { if (hanabi != null) { return hanabi; } synchronized (Hanabi.cl.原创 2021-01-20 11:23:56 · 84 阅读 · 0 评论 -
RSA With Swagger
package com.winplan365.othink.rest.controller;import com.fasterxml.jackson.databind.ObjectMapper;import com.winplan365.othink.rest.dto.CryptoDto;import com.winplan365.othink.rest.model.response.Response;import com.winplan365.othink.rest.properties.R..原创 2021-01-20 09:41:47 · 184 阅读 · 0 评论 -
Arrays.sort()
String str = "You are a page in my book of life that I am never able to turn over. My life is stuck in the moment when you turned your back against me."; String str1 = "present=past&hate=love&deep=shallow&absolute=relative&...原创 2021-01-20 09:22:06 · 63 阅读 · 0 评论 -
I Want To Be Loved By You
package com.winplan365.othink.rest.controller;import com.fasterxml.jackson.databind.ObjectMapper;import com.winplan365.othink.rest.dto.CryptoDto;import com.winplan365.othink.rest.model.response.Response;import com.winplan365.othink.rest.properties.R..原创 2021-01-19 19:15:38 · 126 阅读 · 0 评论 -
She Will Be Loved By Everyone Else Other Than You
package com.winplan365.othink.rest.controller;import com.fasterxml.jackson.databind.ObjectMapper;import com.winplan365.othink.rest.dto.CryptoDto;import com.winplan365.othink.rest.model.response.Response;import com.winplan365.othink.rest.tool.RSAUtil..原创 2021-01-19 17:08:33 · 85 阅读 · 0 评论 -
RSA, Jackson, and DecimalFormat
package com.sf.test.json;import com.fasterxml.jackson.core.JsonGenerator;import com.fasterxml.jackson.core.JsonProcessingException;import com.fasterxml.jackson.databind.JsonSerializer;import com.fasterxml.jackson.databind.SerializerProvider;import .原创 2021-01-19 16:36:14 · 99 阅读 · 0 评论 -
She Drifted Away With The Wind, Beyond The Reach Of My Wildest Dreams. Not Even RSA Algorithms Can..
package com.sf.test;import org.apache.commons.codec.binary.Base64;import javax.crypto.Cipher;import java.nio.charset.StandardCharsets;import java.security.*;import java.security.spec.PKCS8EncodedKeySpec;import java.security.spec.X509EncodedKeySpec.原创 2021-01-19 15:38:47 · 55 阅读 · 0 评论 -
Swagger, What A Drama Queen!
package com.winplan365.othink.rest.controller;import com.winplan365.othink.rest.model.response.Response;import io.swagger.annotations.*;import org.springframework.web.bind.annotation.*;@Api(value = "FoxIsBeautifulAndDangerous", description = "She w..原创 2021-01-19 14:53:51 · 128 阅读 · 0 评论 -
volatile in Java
volatile variables are stored in main memory, and never optimized away (for instance, storing in the CPU cache). Once the volatile variables are changed, they would be visible to all users. this means that volatile variables are not cached, every access n原创 2020-05-25 19:39:27 · 107 阅读 · 0 评论