d
This commit is contained in:
		| @@ -1,5 +1,7 @@ | |||||||
| package osc.git.eh3.test; | package osc.git.eh3.test; | ||||||
|  |  | ||||||
|  | import org.apache.commons.codec.binary.Hex; | ||||||
|  |  | ||||||
| import java.text.ParseException; | import java.text.ParseException; | ||||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
| @@ -248,12 +250,12 @@ public class TestCode { | |||||||
| //		System.out.println(s1); | //		System.out.println(s1); | ||||||
| //		System.out.println(new String(s1.getBytes("gbk"))); | //		System.out.println(new String(s1.getBytes("gbk"))); | ||||||
| //		System.out.println(); | //		System.out.println(); | ||||||
| //		 | //// | ||||||
| //		String s2 = URLEncoder.encode(str, "utf-8"); | //		String s2 = URLEncoder.encode(str, "utf-8"); | ||||||
| //		System.out.println(s2); | //		System.out.println(s2); | ||||||
| //		System.out.println(URLDecoder.decode(s2,"utf-8")); | //		System.out.println(URLDecoder.decode(s2,"utf-8")); | ||||||
|  |  | ||||||
|  |         System.out.println(new String(Hex.decodeHex("E8AFB7E6B182E5A4B1E8B4A5EFBC8CE8AFB7E7A88DE5908EE9878DE8AF95".toCharArray()), "utf-8")); | ||||||
| //		Object object = null; | //		Object object = null; | ||||||
| //		JSONObject creativeGroupObj = JSONObject.fromObject(object); | //		JSONObject creativeGroupObj = JSONObject.fromObject(object); | ||||||
| //		System.out.println(creativeGroupObj.isEmpty()); | //		System.out.println(creativeGroupObj.isEmpty()); | ||||||
| @@ -370,8 +372,8 @@ public class TestCode { | |||||||
|         //int size = list.size(); |         //int size = list.size(); | ||||||
|         //String[] arr = list.toArray(new String[size]);//使用了第二种接口,返回值和参数均为结果 |         //String[] arr = list.toArray(new String[size]);//使用了第二种接口,返回值和参数均为结果 | ||||||
|  |  | ||||||
|         String str = null; |         //String str = null; | ||||||
|         System.out.println((String)str == null); |         //System.out.println((String)str == null); | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								src/main/java/osc/git/eh3/test/TestDecodeHex.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/main/java/osc/git/eh3/test/TestDecodeHex.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | package osc.git.eh3.test; | ||||||
|  |  | ||||||
|  | import org.apache.commons.codec.binary.Hex; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Created by lixiangrong on 2016/9/12. | ||||||
|  |  */ | ||||||
|  | public class TestDecodeHex { | ||||||
|  |     // 十六进制转字符串 | ||||||
|  |     public static void main(String[] args) throws Exception { | ||||||
|  |         String data = "E7A7AFE69E81E58AA0E5BFABE7A791E68A80"; | ||||||
|  |         System.out.println(new String(Hex.decodeHex(data.toCharArray()), "utf-8")); | ||||||
|  |  | ||||||
|  |         System.out.println(Hex.encodeHexString("测试粗我".getBytes())); | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										11
									
								
								src/main/java/osc/git/eh3/test/TestException.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/main/java/osc/git/eh3/test/TestException.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | package osc.git.eh3.test; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Created by lixiangrong on 2016/8/31. | ||||||
|  |  */ | ||||||
|  | public class TestException { | ||||||
|  |  | ||||||
|  |     public static void main(String[] args) { | ||||||
|  |         System.out.println("0000"); | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user