JavaÖÐѹËõÓë½âѹ ÖÐÎÄÎļþÃûÂÒÂë½â¾ö°ì·¨
http://xxw8393.blog.163.com/blog/static/37256834200993051226320/
java¶Ôì¶ÎÄ×ֵıàÂëÊÇÒÔ unicodeΪ»ù´¡£¬Òò´Ë£¬ÈôÊÇÒÔZipInputStream¼°ZipOutputStreamÀ´´¦ÀíѹËõ¼°½âѹËõµÄ¹¤×÷£¬Åöµ½ÖÐÎĵµÃû»ò·¾¶£¬Äǵ±È»ÊÇÒÔunicodeÀ´´¦ÀíÂÞ£¡µ«ÊÇ£¬ÏÖÔÚÊÐÃæÉϵÄѹËõ¼°½âѹËõÈíÌ壬ÀýÈçwinzip£¬È´ÊDz»Ö§Ô®unicodeµÄ£¬Ò»Åöµ½µµÃûÒÔunicode±àÂëµÄµµ°¸£¬Ëü¾Í²»´¦Àí¡£ÄÇÒªÈçºÎ²ÅÄÜ×ö³öÈÃWinRarÄܹ»´¦ÀíµÄѹËõµµÄØ£¿ÄǾ͵ôÓÐÞ¸ÄZipInputStream¼°ZipOutputStream¶Ô춵µÃûµÄ±àÂ뷽ʽÀ´×ÅÊÖÁË¡£ÎÒÃÇ¿ÉÒÔ´ÓjdkµÄsrc.zipÈ¡µÃZipInputStream¼°ZipOutputStreamµÄÔʼÂëÀ´¼ÓÒÔÐÞ¸Ä
Ò»¡¢ZipOutputStream.java
1.´ÓjdkµÄsrc.zipÈ¡µÃZipOutputStream.javaÔʼÂ룬Áí´æµ½Ò»¸öÐÂÎļþÖУ¬µµÃû¸ÄΪCnZipOutputStream.java¡£
2.¿ªÊ¼ÐÞ¸ÄÔʼÂ룬½«classÃû³Æ¸ÄΪCnZipOutputStream
3.½¨¹¹Ê½Ò²±ØÐë¸ü¸ÄΪCnZipOutputStream
4.ÐÂÔömember£¬Õâ¸ömember¼Ç¼±àÂ뷽ʽ
private String encoding="UTF-8";
5.ÔÙÐÂÔöÒ»¸ö½¨¹¹Ê½(Õâ¸ö½¨¹¹Ê½¿ÉÒÔÈÃÕâ¸öclassÔÚnewµÄʱºò£¬É趨µµÃûµÄ±àÂë)
public CZipOutputStream(OutputStream out,String encoding) {
this(out);
this.encoding=encoding;
}
6.ÕÒµ½byte[] nameBytes = getUTF8Bytes(e.name);(Óжþ¸öµØ·½)£¬½«ËüÐÞ¸ÄÈçÏ£º
byte[] nameBytes = null;
try
{
if (this.encoding.toUpperCase().equals("UTF-8"))
nameBytes =getUTF8Bytes(e.name);
else
nameBytes= e.name.getBytes(this.encoding);
}
catch(Exception byteE)
{
nameBytes=getUTF8Bytes(e.name);
}
¶þ¡¢ZipInputStream.java
1.´ÓjdkµÄsrc.zipÈ¡µÃZipInputStream.javaÔʼÂ룬Áí´æµ½Ò»¸öÐÂÎļþÖУ¬µµÃû¸ÄΪCnZipInputStream.java¡£
2.¿ªÊ¼ÐÞ¸ÄÔʼÂ룬½«classÃû³Æ¸ÄΪCnZipInputStream
3.½¨¹¹Ê½Ò²±ØÐë¸ü¸ÄΪCnZipInputStream
4.ÐÂÔömember£¬Õâ¸ömember¼Ç¼±àÂ뷽ʽ
private String encoding="UTF-8";
5.ÔÙÐÂÔöÒ»¸ö½¨¹¹Ê½ÈçÏÂ(Õâ¸ö½¨¹¹Ê½¿ÉÒÔÈÃÕâ¸öclassÔÚnewµÄʱºò£¬É趨µµÃûµÄ±àÂë)
public CZipInputStream(InputStream in,String encoding) {
this(in);
this.encoding=encoding;
}
6.ÕÒµ½ZipEntry e = createZipEntry(getUTF8String(b, 0, len));ÕâÒ»ÐУ¬½«
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
×òÌì¿´µ½Ò»¸öÌâÄ¿£ºjavaÒì³£»úÖƺÍÀ¬»ø´¦Àí»úÖÆ£¬·¢ÏÖƽʱÓõÄʱºòҲû̫עÒ⣬ÄùýÀ´¾ÍÓá£Ñ§Ï°ÕⶫÎ÷¾ÍµÃ²»¶Ï×ܽᡢ»ýÀÛ£¬²»È»Ê±¼ä³¤»¹Ë»¹¼ÇµÃËü³¤É¶Ñù¡£
javaÒì³£»ù±¾¸ÅÄî¾Í²»ÓÃ˵ÁË£¬
javaÒì³£Ö÷Òª·ÖΪÈýÀࣺ
1£©±àÒëʱÒì³£java.lang.Exception
2)ÔËÐÐʱÒì³£ java.lang.RuntimeException
&nb ......
1¡¢±ØÐëÒýÈ룺java.text.SimpleDateFormat
2¡¢ÉèÖÃÏÔʾ·½Ê½£¬µ÷ÓÃformat¸ñʽ¡£
SimpleDateFormat sdf=new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ");
String date=sdf.format(blog.getCreatedTime());
sdf=new Simp ......
ÕÐÉÌÏîÄ¿ÐèÒªÒý½øÒ»¸ö¹¤×÷Á÷£¬×î½üÔÚÍùÉϵ÷ÑпªÔ´µÄ¹¤×÷Á÷ÒýÇ棬×ܽá±È½ÏÁ÷ÐÐÒ»¹²ÓÐ3¸ö¡£
ÆäÖÐÒ»¸öÊÇosworkflow£¬µ«ÊÇÓÉÓںܳ¤Ê±¼ä²»ÔÙ¸üУ¬ËùÒÔÑ¡Ôñ·ÅÆú¡£ÁíÍâÒ»¸ö¾ÍÊÇjbmp4.3£¬¿ªÁ˺ܶàµÄ×ÊÁÏ»¹ÓÐÊÓƵ£¬·¢ÏÖÆäÖкܶණÎ÷Àí½âÀ§ÄÑ£¬»¹ÓÐÒ»¸öÎÊÌâ¾ÍÊÇËüµÄ³Ö¾Ã²ãÊÇhibernate×öµÄ£¬±¾ÏëÏÈÇ°ÏëÓÃibatisµÄ¡£¹À¼ÆÒªÊÇÕæµÄÒý½ø¹ ......