Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 <


Ïà¹ØÎĵµ£º

ÔÚjavaÖÐʹÓÃίÍÐʵÏÖmap/filter

ÔÚjavaÖУ¬¼ÙÉèÄãÓÐÒ»¸öuser ¶ÔÏóµÄlist£¬´Ëuser¶ÔÏó·â×°ÁËÓû§µÄid, first name, last name and age. È»ºóÄãÏëµ÷ÓÃÒ»¸öweb service(eg. UserService.deleteUsersByIds(List<Integer> userIds) ȥɾ³ýÊý¾Ý¿âÖÐÖ¸¶¨µÄÕâЩuser¡£  ÌýÆðÀ´Ëƺõ²»Ì«À§ÄÑ£¬²»ÊÇô? ÄãËùÐèÒªÖ»Êǽ« List<User> ת»¯³ÉList&l ......

java»ù´¡ÈëÃÅѧϰ±Ê¼Ç(Ò»):bubblesortËã·¨¸öÈËѧϰ


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ÖÐXML½âÎöÀûÆ÷ dom4jµÄʹÓüò½é


ҪʹÓÃdom4j¶ÁдXMLÎĵµ,ÐèÒªÏÈÏÂÔØdom4j°ü,dom4j¹Ù·½ÍøÕ¾ÔÚ http://www.dom4j.org/
Ä¿Ç°×îÐÂdom4j°üÏÂÔصØÖ·: http://nchc.dl.sourceforge.net/sourceforge/dom4j/dom4j-1.6.1.zip
½â¿ªºóÓÐÁ½¸ö°ü,½ö²Ù×÷XMLÎĵµµÄ»°°Ñdom4j-1.6.1.jar¼ÓÈ빤³Ì¾Í¿ÉÒÔÁË,Èç¹ûÐèҪʹÓÃXPathµÄ»°»¹ÐèÒª¼ÓÈë°üjaxen-1.1-beta-7.jar.
ÒÔÏÂ ......

È«ÇòʯÓÍÍøÕÐƸjava¹¤³Ìʦ

È«ÇòʯÓÍÍø£¨www.cippe.net£©´´½¨ÓÚ2004Ä꣬Öص㱨µÀÈ«ÇòʯÓ͹¤ÒµÐ²úÆ·¡¢Ð¼¼Êõ£¬¼á³ÖÆ·ÅÆ»¯¡¢×¨Òµ»¯¡¢¹ú¼Ê»¯µÄÕ½ÂÔ·¢Õ¹·½Ïò£¬´Ù½øÈ«ÇòʯÓ͹¤Òµ¼¼Êõ½»Á÷Óë×°±¸Ã³Ò×£¬ÍƽøÖйúʯÓ͹¤Òµ»¯·¢Õ¹Ëٶȣ¡
ÍøÕ¾º­¸ÇµØÖÊ¿±Ì½¡¢ÓÍÆø²Ø¡¢×ê¾®¡¢²â¾®¡¢²ÉÓÍ¡¢×°±¸¡¢º£ÑóʯÓÍ¡¢´¢ÔË¡¢Á¶»¯µÈרҵÁìÓò£¬´´°ìÁËʯÓÍ×ÊѶ¡¢Ð²úƷм¼Êõ¡¢Ê¯Ó ......

JAVA JNI

http://blog.csdn.net/hbcui1984/archive/2009/12/10/4980805.aspx
Ò»¡¢¸ÅÊö
JNI(java native interface)£¬JAVA±¾µØ½Ó¿Úµ÷Óã¬Ä¿µÄÊÇΪÁËJAVA¿ÉÒÔµ÷Óñ¾µØ³ÌÐò£¬Ö÷ÒªÓŵãÓУº
Ìá¸ßЧÂÊ£¬½â¾öÐÔÄÜÎÊÌâ
·ÀÖ¹·´±àÒ룬Ìá¸ßºËÐÄ´úÂ밲ȫÐÔ
ÔöÇ¿±¾»ú½Ó¿Úµ÷ÓÃ
ǶÈëʽ¿ª·¢Ó¦ÓÃ
    ÈçÏÂͨ¹ýÒ»¸ö×î¼òµ¥µÄÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ