3des¼ÓÃÜËã·¨µÄJavaʵÏÖ
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
public class CipherTest {
public static void main(String[] args) {
try {
byte[] keydata = { (byte) 0x00, (byte) 0x01, (byte) 0x02,
(byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
(byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a,
(byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e,
(byte) 0x0f, (byte) 0x10, (byte) 0x11, (byte) 0x12,
(byte) 0x13, (byte) 0x14, (byte) 0x15, (byte) 0x16,
(byte) 0x17, };
String algorithm = "DESede";
String clearTextString = "I wanna be with you.";
String encoding = "US-ASCII";
// javax.crypto.spec.DESedeKeySpec
SecretKey key = new SecretKeySpec(keydata, algorithm);
Cipher cipher = Cipher.getInstance(algorithm);
byte[] clearText = clearTextString.getBytes(encoding);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] encryptedText = cipher.doFinal(clearText);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decryptedText = cipher.doFinal(encryptedText);
System.out.println("********************************************");
System.out.println(new String(clearText, encoding));
System.out.println(bytesToString(clearText));
System.out.println("********************************************");
System.out.println(new String(encryptedText, encoding));
System.out.println(bytesToString(encryptedText));
System.out.println("********************************************");
System.out.println(new String(decryptedText, encoding));
System.out.println(bytesToString(decryptedText));
System.out.println("********************************************");
} catch (Exception e) {
e.printStackTrace();
}
}
private static String bytesToString(byte[] b) {
if (b == null)
return null;
StringBuffer sb = null;
sb = new StringBuffer();
for (int i = 0; i <
Ïà¹ØÎĵµ£º
windows xpÏÂÅäÖÃJDK»·¾³±äÁ¿£º
1.°²×°JDK£¬°²×°¹ý³ÌÖпÉÒÔ×Ô¶¨Ò尲װĿ¼µÈÐÅÏ¢£¬ÀýÈçÎÒÃÇÑ¡Ôñ°²×°Ä¿Â¼ÎªD:\java\jdk1.5.0_08£»
¡¡ 2.°²×°Íê³Éºó£¬ÓÒ»÷“ÎҵĵçÄÔ”£¬µã»÷“ÊôÐÔ”£»
3.Ñ¡Ôñ“¸ß¼¶”Ñ¡Ï£¬µã»÷“ ......
public class bubblesort {
public static void main(String[] args) {
int array[]=new int[]{1,5,9,4,6,2};
int m;
for(int i=0;i<array.length;i++){
System.out.print(arra ......
ÔÚJava concurrent°üÖÐÓÐÕâôһ¸ö½Ó¿Ú£ºConcurrentMap¡£
ConcurrentMap¼Ì³Ð×ÔMap£¬²¢Ìí¼ÓÁ˼¸¸öеÄÔ×Ó·½·¨£º putIfAbsent¡¢remove¡¢replace
Æä·½·¨ÕªÒªÈçÏ£º
V
putIfAbsent(K key, V value)
Èç¹ûÖ¸¶¨¼üÒѾ²»ÔÙÓëij¸öÖµÏà¹ØÁª£¬Ôò½ ......
ǰһ¶Îʱ¼äÒòΪÐèÒª°ï±ðÈËдÁ˼òµ¥µÄ×Ö·û´®·Ö¸ôµÄjavaС³ÌÐò£¬¾¡¹Ü×îºóûÓÃÉÏ£¬µ«ÊÇ×÷ΪÁ·Ï°»¹ÊDz»´íµÄ¡£
ÐèÇ󣺶ÔÓÚÏñÈçϵÄ×Ö·û´´½«Æä·Ö¸ôΪÁ½ÁУ¬ÕâÑù¾Í¿ÉÒÔÖ±½ÓÕ³ÌùµÄExcelÖи÷×ÔÁУ¬·ñÔòÒ»¸öÒ»¸ö·Ö¸ô»áºÄ·ÑºÜ¶àʱ¼ä¡£
16 bit microcomputer 16 λ΢ÐͼÆËã»ú
3 d distribution Èýά·Ö²¼
4 ......
Ò»¡¢Java ClassLoader
1£¬Ê²Ã´ÊÇClassLoader
Óë C »ò C++ ±àдµÄ³ÌÐò²»Í¬£¬Java ³ÌÐò²¢²»ÊÇÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬¶øÊÇÓÉÐí¶à¶ÀÁ¢µÄÀàÎļþ×é³É£¬Ã¿Ò»¸öÎļþ¶ÔÓ¦ÓÚÒ»¸ö Java Àà¡£
´ËÍ⣬ÕâЩÀàÎļþ²¢·ÇÁ¢¼´È«²¿¶¼×°ÈëÄڴ棬¶øÊǸù¾Ý³ÌÐòÐèҪװÈëÄÚ´æ¡£ClassLoader ÊÇ JVM Öн«Àà×°ÈëÄÚ´æµÄÄDz¿·Ö¡£
¶øÇÒ£¬Java ClassLoader ......