Base64±àÂëÓë½âÂëµÄjavaʵÏÖ
public class Base64 {
//Âë±í
static private char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
.toCharArray();
//codesÀï´æ·ÅµÄÊÇÖµ±í
//¿ÉÒÔÕâôÀí½â¸ù¾ÝÂë±íÖеÄÖµ¿ÉÒԵõ½±àÂëÇ°µÄÖµ
//Èçcodes['A']=0,¼´ÎªÆäË÷ÒýÖµ
static private byte[] codes = new byte[256];
static {
for (int i = 0; i < 256; i++)
codes[i] = -1;
for (int i = 'A'; i <= 'Z'; i++)
codes[i] = (byte) (i - 'A');
for (int i = 'a'; i <= 'z'; i++)
codes[i] = (byte) (26 + i - 'a');
for (int i = '0'; i <= '9'; i++)
codes[i] = (byte) (52 + i - '0');
codes['+'] = 62;
codes['/'] = 63;
}
/**
* ½«ÔʼÊý¾Ý±àÂëΪbase64±àÂë
*/
static public char[] encode(byte[] data) {
//¶ÔÓÚÔÎĵÄ×Ö½ÚÊýÁ¿ÊÇ3µÄ±¶ÊýµÄʱºò,ת»»ºóµÄ×Ö·û´®ÀíÂÛÉϽ«Òª±ÈÔÀ´µÄ³¤1/3,¼´ÔÀ´µÄ4/3.
//µ±ÔÎĵÄ×Ö½ÚÊý²»ÊÇ3µÄ±¶ÊýµÄʱºò,²»×ãµÄµØ·½ÎÒÃDz¹È«.
//¹ÊÔÎIJ¹È«ºóµÄ×î´ó³¤¶ÈΪ Ô×Ö·û´®³¤¶È+2
//±àÂëºóµÄ³¤¶ÈΪ(Ô×Ö·û´®³¤¶È+2)*3/4
char[] out = new char[((data.length + 2) / 3) * 4];
Ïà¹ØÎĵµ£º
Ò»£º×¼±¸ www.savarese.org download
1. rocksaw-1.0.0-src.tar.gz
2. vserv-tcpip-0.9.2-src.tar.gz
¶þ£º±àÒëÔ´ÎļþµÃµ½jar°ü ʹÓÃAnt
1. build vserv-tcpip-0.9.2-src
ÔÚvserv-tcpip-0.9.2Ŀ¼ÏÂÃ潨һ¸ötestsĿ¼£¬È»ºóÔÚcmd´°¿ÚϽøÈë ......
ÀýÈ磺һ¸ö×Ö·û´®£º123fsf¶á
¸ÄºóҪΪ£º1%2%3%f%s%f%¶á
´úÂëÈçÏÂ
String a="123fsf¶á";
char[] b=a.toCharArray();//×Ö·û´®²ð·Ö³É×Ö·û
&n ......
finalÔÚJavaÖв¢²»³£Óã¬È»¶øËüȴΪÎÒÃÇÌṩÁËÖîÈçÔÚCÓïÑÔÖж¨Òå³£Á¿µÄ¹¦ÄÜ£¬²»½öÈç´Ë£¬final»¹¿ÉÒÔÈÃÄã¿ØÖÆÄãµÄ³ÉÔ±¡¢·½·¨»òÕßÊÇÒ»¸öÀàÊÇ·ñ¿É±»¸²Ð´»ò¼Ì³ÐµÈ¹¦ÄÜ£¬ÕâЩÌصãʹfinalÔÚJavaÖÐÓµÓÐÁËÒ»¸ö²»¿É»òȱµÄµØ룬ҲÊÇѧϰJavaʱ±ØÐëÒªÖªµÀºÍÕÆÎյĹؼü×ÖÖ®Ò»¡£
final³ÉÔ±
¡¡¡¡ µ±ÄãÔÚÀàÖж¨Òå±äÁ¿Ê±£¬ÔÚÆäÇ°Ãæ¼ÓÉÏfi ......
java ²Ù×÷cookie
----------------------------------------------------------------------------------------------------------------------------------------------------
дÈëcookie
£¼%
String cookieName="Sender";
Cookie cookie=new Cookie(cookieName, "Test_Content");
cookie.setMaxAge(10);
respo ......
JAVAÖ®IOÁ÷(³¬ÏêϸµÄJava.io°üµÄ½éÉÜ!)
Ò».InputºÍOutput
1.stream´ú±íµÄÊÇÈκÎÓÐÄÜÁ¦²ú³öÊý¾ÝµÄÊý¾ÝÔ´£¬»òÊÇÈκÎÓÐÄÜÁ¦½ÓÊÕÊý¾ÝµÄ½ÓÊÕÔ´¡£
ÔÚJavaµÄIOÖУ¬ËùÓеÄstream£¨°üÀ¨InputºÍOut stream£©¶¼°üÀ¨Á½ÖÖÀàÐÍ£º
1.1 ÒÔ×Ö½ÚΪµ¼ÏòµÄstream
ÒÔ×Ö½ÚΪµ¼ÏòµÄstream£¬±íʾÒÔ×Ö½ÚΪµ¥Î»´ÓstreamÖжÁÈ¡»òÍùstreamÖÐдÈëÐÅÏ ......