{"id":1270,"date":"2016-02-18T21:34:18","date_gmt":"2016-02-18T13:34:18","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1270"},"modified":"2016-02-19T17:38:13","modified_gmt":"2016-02-19T09:38:13","slug":"java%e4%b8%ad%e7%9a%84io%e6%9c%80%e5%85%a8%e9%9d%a2%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1270","title":{"rendered":"java\u4e2d\u7684IO\u6700\u5168\u9762\u6574\u7406"},"content":{"rendered":"<p>\u5199\u5728\u524d\u9762\uff1a\u672c\u6587\u7ae0\u57fa\u672c\u8986\u76d6\u4e86java IO\u7684\u5168\u90e8\u5185\u5bb9\uff0cjava\u65b0IO\u6ca1\u6709\u6d89\u53ca\uff0c\u56e0\u4e3a\u6211\u60f3\u548c\u8fd9\u4e2a\u5206\u5f00\uff0c\u4ee5\u7a81\u51fa\u90a3\u4e2a\u7684\u91cd\u8981\u6027\uff0c\u65b0IO\u54ea\u4e00\u7bc7\u6587\u7ae0\u8fd8\u6ca1\u6709\u5f00\u59cb\u5199\uff0c\u4f30\u8ba1\u5f88\u5feb\u5c31\u80fd\u548c\u5927\u5bb6\u89c1\u9762\u3002\u7167\u65e7\uff0c\u6587\u7ae0\u4f9d\u65e7\u4ee5\u4f8b\u5b50\u4e3a\u4e3b\uff0c\u56e0\u4e3a\u8bb2\u89e3\u5185\u5bb9\u7684java\u4e66\u5f88\u591a\u4e86\uff0c\u6211\u89c9\u7684\u5b66\u4ee5\u81f4\u7528\u624d\u662f\u771f\u3002\u4ee3\u7801\u662f\u5199\u51fa\u6765\u7684\uff0c\u4e0d\u662f\u770b\u51fa\u6765\u7684\u3002<!--more--><br \/>\n\u6700\u540e\u6b22\u8fce\u5927\u5bb6\u63d0\u51fa\u610f\u89c1\u548c\u5efa\u8bae\u3002<\/p>\n<p>\u76ee\u5f55<br \/>\n<div id=\"sc_tips\">\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6<br \/>\nFile\u7c7b\u7684\u4e24\u4e2a\u5e38\u91cf<br \/>\n\u518c\u9664\u4e00\u4e2a\u6587\u4ef6<br \/>\n\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939<br \/>\n\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09<br \/>\n\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09<br \/>\n\u5224\u65ad\u4e00\u4e2a\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u4e3a\u76ee\u5f55<br \/>\n\u641c\u7d22\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u5185\u5bb9<br \/>\n\u4f7f\u7528RandomAccessFile\u5199\u5165\u6587\u4ef6<\/p>\n<p>\u5b57\u8282\u6d41<br \/>\n\u5411\u6587\u4ef6\u4e2d\u5199\u5165\u5b57\u7b26\u4e32<br \/>\n\u5411\u6587\u4ef6\u4e2d\u8ffd\u52a0\u65b0\u5185\u5bb9<br \/>\n\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/p>\n<p>\u5b57\u7b26\u6d41<br \/>\n\u5411\u6587\u4ef6\u4e2d\u5199\u5165\u6570\u636e<br \/>\n\u4ece\u6587\u4ef6\u4e2d\u8bfb\u5185\u5bb9<br \/>\n\u5173\u4e8e\u5b57\u8282\u6d41\u548c\u5b57\u7b26\u6d41\u7684\u533a\u522b<br \/>\n\u4f7f\u7528\u5b57\u8282\u6d41\u597d\u8fd8\u662f\u5b57\u7b26\u6d41\u597d\u5462\uff1f<br \/>\n\u6587\u4ef6\u7684\u590d\u5236<br \/>\nOutputStreramWriter \u548cInputStreamReader\u7c7b<br \/>\n\u5c06\u5b57\u8282\u8f93\u51fa\u6d41\u8f6c\u5316\u4e3a\u5b57\u7b26\u8f93\u51fa\u6d41<br \/>\n\u5c06\u5b57\u8282\u8f93\u5165\u6d41\u53d8\u4e3a\u5b57\u7b26\u8f93\u5165\u6d41<br \/>\n\u4f7f\u7528\u5185\u5b58\u64cd\u4f5c\u6d41\u5c06\u4e00\u4e2a\u5927\u5199\u5b57\u6bcd\u8f6c\u5316\u4e3a\u5c0f\u5199\u5b57\u6bcd<\/p>\n<p>\u7ba1\u9053\u6d41<br \/>\n\u9a8c\u8bc1\u7ba1\u9053\u6d41<br \/>\n\u6253\u5370\u6d41<br \/>\n\u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411<br \/>\nBufferedReader\u7684\u5c0f\u4f8b\u5b50<br \/>\nScanner\u7c7b<br \/>\n\u6570\u636e\u64cd\u4f5c\u6d41DataOutputStream\u3001DataInputStream\u7c7b<br \/>\n\u5408\u5e76\u6d41 SequenceInputStream<br \/>\n\u6587\u4ef6\u538b\u7f29 ZipOutputStream\u7c7b<br \/>\nZipInputStream\u7c7b<br \/>\nPushBackInputStream\u56de\u9000\u6d41<br \/>\n\u5bf9\u8c61\u7684\u5e8f\u5217\u5316<br \/>\nExternalizable\u63a5\u53e3<br \/>\n<\/div><\/p>\n<p>\u3010\u6848\u4f8b1\u3011\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(&#8220;D:\\\\hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f.createNewFile();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u7a0b\u5e8f\u8fd0\u884c\u4e4b\u540e\uff0c\u5728d\u76d8\u4e0b\u4f1a\u6709\u4e00\u4e2a\u540d\u5b57\u4e3ahello.txt\u7684\u6587\u4ef6\u3002<\/p>\n<p>\u3010\u6848\u4f8b2\u3011File\u7c7b\u7684\u4e24\u4e2a\u5e38\u91cf<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(File.separator);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(File.pathSeparator);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\\<\/p>\n<p>;<\/p>\n<p>\u6b64\u5904\u591a\u8bf4\u51e0\u53e5\uff1a\u6709\u4e9b\u540c\u5b66\u53ef\u80fd\u8ba4\u4e3a\uff0c\u6211\u76f4\u63a5\u5728windows\u4e0b\u4f7f\u7528\\\u8fdb\u884c\u5206\u5272\u4e0d\u884c\u5417\uff1f\u5f53\u7136\u662f\u53ef\u4ee5\u7684\u3002\u4f46\u662f\u5728linux\u4e0b\u5c31\u4e0d\u662f\\\u4e86\u3002\u6240\u4ee5\uff0c\u8981\u60f3\u4f7f\u5f97\u6211\u4eec\u7684\u4ee3\u7801\u8de8\u5e73\u53f0\uff0c\u66f4\u52a0\u5065\u58ee\uff0c\u6240\u4ee5\uff0c\u5927\u5bb6\u90fd\u91c7\u7528\u8fd9\u4e24\u4e2a\u5e38\u91cf\u5427\uff0c\u5176\u5b9e\u4e5f\u591a\u5199\u4e0d\u4e86\u51e0\u884c\u3002\u5475\u5475\u3001<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u4f7f\u7528File\u7c7b\u4e2d\u7684\u5e38\u91cf\u6539\u5199\u4e0a\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f.createNewFile();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f60\u770b\uff0c\u6ca1\u6709\u591a\u5199\u591a\u5c11\u5427\uff0c\u5475\u5475\u3002\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528File\u7c7b\u4e2d\u7684\u5e38\u91cf\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u5220\u9664\u4e00\u4e2a\u6587\u4ef6<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5220\u9664\u4e00\u4e2a\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(f.exists()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f.delete();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}else{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u6587\u4ef6\u4e0d\u5b58\u5728&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f.mkdir();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>D\u76d8\u4e0b\u591a\u4e86\u4e00\u4e2ahello\u6587\u4ef6\u5939<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09\uff1a<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528list\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String[] str=f.list();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; str.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(str[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>$RECYCLE.BIN<\/p>\n<p>360<\/p>\n<p>360Downloads<\/p>\n<p>360Rec<\/p>\n<p>360SoftMove<\/p>\n<p>Config.Msi<\/p>\n<p>da<\/p>\n<p>Downloads<\/p>\n<p>DriversBackup<\/p>\n<p>eclipse<\/p>\n<p>java web\u6574\u5408\u5f00\u53d1\u548c\u9879\u76ee\u5b9e\u6218<\/p>\n<p>Lenovo<\/p>\n<p>MSOCache<\/p>\n<p>Program<\/p>\n<p>Program Files<\/p>\n<p>python<\/p>\n<p>RECYGLER.{8F92DA15-A229-A4D5-B5CE-5280C8B89C19}<\/p>\n<p>System Volume Information<\/p>\n<p>Tomcat6<\/p>\n<p>var<\/p>\n<p>vod_cache_data<\/p>\n<p>\u65b0\u5efa\u6587\u4ef6\u5939<\/p>\n<p>\uff08\u4f60\u7684\u8fd0\u884c\u7ed3\u679c\u5e94\u8be5\u548c\u8fd9\u4e2a\u4e0d\u4e00\u6837\u7684\uff0c\u5475\u5475\uff09<\/p>\n<p>\u4f46\u662f\u4f7f\u7528list\u8fd4\u56de\u7684\u662fString\u6570\u7ec4\uff0c\u3002\u800c\u4e14\u5217\u51fa\u7684\u4e0d\u662f\u5b8c\u6574\u8def\u5f84\uff0c\u5982\u679c\u60f3\u5217\u51fa\u5b8c\u6574\u8def\u5f84\u7684\u8bdd\uff0c\u9700\u8981\u4f7f\u7528listFiles.\u4ed6\u8fd4\u56de\u7684\u662fFile\u7684\u6570\u7ec4<\/p>\n<p><strong>\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09\uff1a<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528listFiles\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* listFiles\u8f93\u51fa\u7684\u662f\u5b8c\u6574\u8def\u5f84<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File[] str=f.listFiles();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; str.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(str[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>D:\\$RECYCLE.BIN<\/p>\n<p>D:\\360<\/p>\n<p>D:\\360Downloads<\/p>\n<p>D:\\360Rec<\/p>\n<p>D:\\360SoftMove<\/p>\n<p>D:\\Config.Msi<\/p>\n<p>D:\\da<\/p>\n<p>D:\\Downloads<\/p>\n<p>D:\\DriversBackup<\/p>\n<p>D:\\eclipse<\/p>\n<p>D:\\java web\u6574\u5408\u5f00\u53d1\u548c\u9879\u76ee\u5b9e\u6218<\/p>\n<p>D:\\Lenovo<\/p>\n<p>D:\\MSOCache<\/p>\n<p>D:\\Program<\/p>\n<p>D:\\Program Files<\/p>\n<p>D:\\python<\/p>\n<p>D:\\RECYGLER.{8F92DA15-A229-A4D5-B5CE-5280C8B89C19}<\/p>\n<p>D:\\System Volume Information<\/p>\n<p>D:\\Tomcat6<\/p>\n<p>D:\\var<\/p>\n<p>D:\\vod_cache_data<\/p>\n<p>D:\\\u65b0\u5efa\u6587\u4ef6\u5939<\/p>\n<p>\u901a\u8fc7\u6bd4\u8f83\u53ef\u4ee5\u6307\u5b9a\uff0c\u4f7f\u7528listFiles\u66f4\u52a0\u65b9\u4fbf\u3001<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u5224\u65ad\u4e00\u4e2a\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u4e3a\u76ee\u5f55<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528isDirectory\u5224\u65ad\u4e00\u4e2a\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u4e3a\u76ee\u5f55<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(f.isDirectory()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;YES&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}else{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;NO&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1aYES<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u641c\u7d22\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u5185\u5bb9<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u7684\u5168\u90e8\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void print(File f){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(f!=null){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(f.isDirectory()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File[] fileArray=f.listFiles();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(fileArray!=null){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; fileArray.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u9012\u5f52\u8c03\u7528<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(fileArray[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\framepages\\web4welcome_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\help_005fhome_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\help_005fhome_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\home_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\home_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\index_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\index_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\login_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\login_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\modify_005fuser_005finfo_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\modify_005fuser_005finfo_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\register_005fnotify_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\register_005fnotify_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\sign_005fup_jsp.class<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\sign_005fup_jsp.java<\/p>\n<p>D:\\Tomcat6\\work\\Catalina\\localhost\\nevel\\org\\apache\\jsp\\transit_jsp.class<\/p>\n<p>\u2026\u2026<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u3010<\/strong><strong>\u4f7f\u7528<\/strong><strong>RandomAccessFile<\/strong><strong>\u5199\u5165\u6587\u4ef6<\/strong><strong>\u3011<\/strong><\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528RandomAccessFile\u5199\u5165\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RandomAccessFile demo=new RandomAccessFile(f,&#8221;rw&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeBytes(&#8220;asdsad&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeInt(12);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeBoolean(true);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeChar(&#8216;A&#8217;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeFloat(1.21f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.writeDouble(12.123);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0demo.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u4f60\u6b64\u65f6\u6253\u5f00hello\u3002txt\u67e5\u770b\u7684\u8bdd\uff0c\u4f1a\u53d1\u73b0\u90a3\u662f\u4e71\u7801\u3002<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h3>\u5b57\u8282\u6d41<\/h3>\n<p>\u3010\u5411\u6587\u4ef6\u4e2d\u5199\u5165\u5b57\u7b26\u4e32\u3011<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5411\u6587\u4ef6\u4e2d\u5199\u5165\u5b57\u7b26\u4e32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream out =new FileOutputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str=&#8221;\u4f60\u597d&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=str.getBytes();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u67e5\u770bhello.txt\u4f1a\u770b\u5230\u201c\u4f60\u597d\u201d<\/p>\n<p>\u5f53\u7136\u4e5f\u53ef\u4ee5\u4e00\u4e2a\u5b57\u8282\u4e00\u4e2a\u5b57\u8282\u7684\u5199\u3002<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5411\u6587\u4ef6\u4e2d\u4e00\u4e2a\u5b57\u8282\u4e00\u4e2a\u5b57\u8282\u7684\u5199\u5165\u5b57\u7b26\u4e32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream out =new FileOutputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str=&#8221;\u4f60\u597d&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=str.getBytes();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; b.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(b[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ed3\u679c\u8fd8\u662f\uff1a\u201c\u4f60\u597d\u201d<\/p>\n<p>&nbsp;<\/p>\n<p>\u5411\u6587\u4ef6\u4e2d\u8ffd\u52a0\u65b0\u5185\u5bb9\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5411\u6587\u4ef6\u4e2d\u8ffd\u52a0\u65b0\u5185\u5bb9\uff1a<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream out =new FileOutputStream(f,true);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str=&#8221;Rollen&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/String str=&#8221;\\r\\nRollen&#8221;;\u00a0 \u53ef\u4ee5\u6362\u884c<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=str.getBytes();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; b.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(b[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u4f60\u597dRollen<\/p>\n<p>&nbsp;<\/p>\n<p>\u3010\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u3011<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u8bfb\u6587\u4ef6\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream in=new FileInputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[1024];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.read(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u4f60\u597dRollen<\/p>\n<p>Rollen_<\/p>\n<p>\u4f46\u662f\u8fd9\u4e2a\u4f8b\u5b50\u8bfb\u53d6\u51fa\u6765\u4f1a\u6709\u5927\u91cf\u7684\u7a7a\u683c\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528in.read(b);\u7684\u8fd4\u56de\u503c\u6765\u8bbe\u8ba1\u7a0b\u5e8f\u3002\u5982\u4e0b\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u8bfb\u6587\u4ef6\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream in=new FileInputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[1024];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int len=in.read(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u8bfb\u5165\u957f\u5ea6\u4e3a\uff1a&#8221;+len);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b,0,len));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u8bfb\u5165\u957f\u5ea6\u4e3a\uff1a18<\/p>\n<p>\u4f60\u597dRollen<\/p>\n<p>Rollen<\/p>\n<p>&nbsp;<\/p>\n<p>\u8bfb\u8005\u89c2\u5bdf\u4e0a\u9762\u7684\u4f8b\u5b50\u53ef\u4ee5\u770b\u51fa\uff0c\u6211\u4eec\u9884\u5148\u7533\u8bf7\u4e86\u4e00\u4e2a\u6307\u5b9a\u5927\u5c0f\u7684\u7a7a\u95f4\uff0c\u4f46\u662f\u6709\u65f6\u5019\u8fd9\u4e2a\u7a7a\u95f4\u53ef\u80fd\u592a\u5c0f\uff0c\u6709\u65f6\u5019\u53ef\u80fd\u592a\u5927\uff0c\u6211\u4eec\u9700\u8981\u51c6\u786e\u7684\u5927\u5c0f\uff0c\u8fd9\u6837\u8282\u7701\u7a7a\u95f4\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u5e72\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u8bfb\u6587\u4ef6\u5185\u5bb9,\u8282\u7701\u7a7a\u95f4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream in=new FileInputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[(int)f.length()];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.read(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u6587\u4ef6\u957f\u5ea6\u4e3a\uff1a&#8221;+f.length());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6587\u4ef6\u957f\u5ea6\u4e3a\uff1a18<\/p>\n<p>\u4f60\u597dRollen<\/p>\n<p>Rollen<\/p>\n<p>&nbsp;<\/p>\n<p>\u5c06\u4e0a\u9762\u7684\u4f8b\u5b50\u6539\u4e3a\u4e00\u4e2a\u4e00\u4e2a\u8bfb\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u8bfb\u6587\u4ef6\u5185\u5bb9,\u8282\u7701\u7a7a\u95f4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream in=new FileInputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[(int)f.length()];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for (int i = 0; i &lt; b.length; i++) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0b[i]=(byte)in.read();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8f93\u51fa\u7684\u7ed3\u679c\u548c\u4e0a\u9762\u7684\u4e00\u6837\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7ec6\u5fc3\u7684\u8bfb\u8005\u53ef\u80fd\u4f1a\u53d1\u73b0\uff0c\u4e0a\u9762\u7684\u51e0\u4e2a\u4f8b\u5b50\u90fd\u662f\u5728\u77e5\u9053\u6587\u4ef6\u7684\u5185\u5bb9\u591a\u5927\uff0c\u7136\u540e\u624d\u5c55\u5f00\u7684\uff0c\u6709\u65f6\u5019\u6211\u4eec\u4e0d\u77e5\u9053\u6587\u4ef6\u6709\u591a\u5927\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5224\u65ad\u662f\u5426\u72ec\u5230\u6587\u4ef6\u7684\u672b\u5c3e\u3002<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u8282\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0*\u8bfb\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream in=new FileInputStream(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[1024];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int count =0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp=in.read())!=(-1)){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0b[count++]=(byte)temp;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0in.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u4f60\u597dRollen<\/p>\n<p>Rollen_<\/p>\n<p>\u63d0\u9192\u4e00\u4e0b\uff0c\u5f53\u72ec\u5230\u6587\u4ef6\u672b\u5c3e\u7684\u65f6\u5019\u4f1a\u8fd4\u56de-1.\u6b63\u5e38\u60c5\u51b5\u4e0b\u662f\u4e0d\u4f1a\u8fd4\u56de-1\u7684<\/p>\n<p>&nbsp;<\/p>\n<h2>\u5b57\u7b26\u6d41<\/h2>\n<p>\u3010\u5411\u6587\u4ef6\u4e2d\u5199\u5165\u6570\u636e\u3011<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u4f7f\u7528\u5b57\u7b26\u6d41<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u7b26\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5199\u5165\u6570\u636e<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Writer out =new FileWriter(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str=&#8221;hello&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(str);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5f53\u4f60\u6253\u5f00hello\u3002txt\u7684\u65f6\u5019\uff0c\u4f1a\u770b\u5230hello<\/p>\n<p>\u5176\u5b9e\u8fd9\u4e2a\u4f8b\u5b50\u4e0a\u4e4b\u524d\u7684\u4f8b\u5b50\u6ca1\u4ec0\u4e48\u533a\u522b\uff0c\u53ea\u662f\u4f60\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u5b57\u7b26\u4e32\uff0c\u800c\u4e0d\u9700\u8981\u4f60\u5c06\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u5b57\u8282\u6570\u7ec4\u3002<\/p>\n<p>\u5f53\u4f60\u5982\u679c\u60f3\u95ee\u6587\u4ef6\u4e2d\u8ffd\u52a0\u5185\u5bb9\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u4f7f\u7528\u5c06\u4e0a\u9762\u7684\u58f0\u660eout\u7684\u54ea\u4e00\u884c\u6362\u4e3a\uff1a<\/p>\n<p>Writer out =<strong>new<\/strong> FileWriter(f,<strong>true<\/strong>);<\/p>\n<p>\u8fd9\u6837\uff0c\u5f53\u4f60\u8fd0\u884c\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u4f1a\u53d1\u73b0\u6587\u4ef6\u5185\u5bb9\u53d8\u4e3a\uff1a<\/p>\n<p>hellohello\u5982\u679c\u60f3\u5728\u6587\u4ef6\u4e2d\u6362\u884c\u7684\u8bdd\uff0c\u9700\u8981\u4f7f\u7528\u201c\\r\\n\u201d<\/p>\n<p>\u6bd4\u5982\u5c06str\u53d8\u4e3aString str=&#8221;\\r\\nhello&#8221;;<\/p>\n<p>\u8fd9\u6837\u6587\u4ef6\u8ffd\u52a0\u7684str\u7684\u5185\u5bb9\u5c31\u4f1a\u6362\u884c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ece\u6587\u4ef6\u4e2d\u8bfb\u5185\u5bb9\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u7b26\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4ece\u6587\u4ef6\u4e2d\u8bfb\u51fa\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char[] ch=new char[100];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Reader read=new FileReader(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int count=read.read(ch);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0read.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u8bfb\u5165\u7684\u957f\u5ea6\u4e3a\uff1a&#8221;+count);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u5185\u5bb9\u4e3a&#8221;+new String(ch,0,count));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u8bfb\u5165\u7684\u957f\u5ea6\u4e3a\uff1a17<\/p>\n<p>\u5185\u5bb9\u4e3ahellohello<\/p>\n<p>hello<\/p>\n<p>&nbsp;<\/p>\n<p>\u5f53\u7136\u6700\u597d\u91c7\u7528\u5faa\u73af\u8bfb\u53d6\u7684\u65b9\u5f0f\uff0c\u56e0\u4e3a\u6211\u4eec\u6709\u65f6\u5019\u4e0d\u77e5\u9053\u6587\u4ef6\u5230\u5e95\u6709\u591a\u5927\u3002<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b57\u7b26\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4ece\u6587\u4ef6\u4e2d\u8bfb\u51fa\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName=&#8221;D:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File f=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char[] ch=new char[100];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Reader read=new FileReader(f);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int count=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp=read.read())!=(-1)){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ch[count++]=(char)temp;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0read.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u5185\u5bb9\u4e3a&#8221;+new String(ch,0,count));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n<p>\u5185\u5bb9\u4e3ahellohello<\/p>\n<p>hello<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5173\u4e8e\u5b57\u8282\u6d41\u548c\u5b57\u7b26\u6d41\u7684\u533a\u522b<\/h3>\n<p>\u5b9e\u9645\u4e0a\u5b57\u8282\u6d41\u5728\u64cd\u4f5c\u7684\u65f6\u5019\u672c\u8eab\u662f\u4e0d\u4f1a\u7528\u5230\u7f13\u51b2\u533a\u7684\uff0c\u662f\u6587\u4ef6\u672c\u8eab\u7684\u76f4\u63a5\u64cd\u4f5c\u7684\uff0c\u4f46\u662f\u5b57\u7b26\u6d41\u5728\u64cd\u4f5c\u7684 \u65f6\u5019\u4e0b\u540e\u662f\u4f1a\u7528\u5230\u7f13\u51b2\u533a\u7684\uff0c\u662f\u901a\u8fc7\u7f13\u51b2\u533a\u6765\u64cd\u4f5c\u6587\u4ef6\u7684\u3002<\/p>\n<p>\u8bfb\u8005\u53ef\u4ee5\u8bd5\u7740\u5c06\u4e0a\u9762\u7684\u5b57\u8282\u6d41\u548c\u5b57\u7b26\u6d41\u7684\u7a0b\u5e8f\u7684\u6700\u540e\u4e00\u884c\u5173\u95ed\u6587\u4ef6\u7684\u4ee3\u7801\u6ce8\u91ca\u6389\uff0c\u7136\u540e\u8fd0\u884c\u7a0b\u5e8f\u770b\u770b\u3002\u4f60\u5c31\u4f1a\u53d1\u73b0\u4f7f\u7528\u5b57\u8282\u6d41\u7684\u8bdd\uff0c\u6587\u4ef6\u4e2d\u5df2\u7ecf\u5b58\u5728\u5185\u5bb9\uff0c\u4f46\u662f\u4f7f\u7528\u5b57\u7b26\u6d41\u7684\u65f6\u5019\uff0c\u6587\u4ef6\u4e2d\u8fd8\u662f\u6ca1\u6709\u5185\u5bb9\u7684\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u8981\u5237\u65b0\u7f13\u51b2\u533a\u3002<\/p>\n<h3>\u4f7f\u7528\u5b57\u8282\u6d41\u597d\u8fd8\u662f\u5b57\u7b26\u6d41\u597d\u5462\uff1f<\/h3>\n<p>\u7b54\u6848\u662f\u5b57\u8282\u6d41\u3002\u9996\u5148\u56e0\u4e3a\u786c\u76d8\u4e0a\u7684\u6240\u6709\u6587\u4ef6\u90fd\u662f\u4ee5\u5b57\u8282\u7684\u5f62\u5f0f\u8fdb\u884c\u4f20\u8f93\u6216\u8005\u4fdd\u5b58\u7684\uff0c\u5305\u62ec\u56fe\u7247\u7b49\u5185\u5bb9\u3002\u4f46\u662f\u5b57\u7b26\u53ea\u662f\u5728\u5185\u5b58\u4e2d\u624d\u4f1a\u5f62\u6210\u7684\uff0c\u6240\u4ee5\u5728\u5f00\u53d1\u4e2d\uff0c\u5b57\u8282\u6d41\u4f7f\u7528\u5e7f\u6cdb\u3002<\/p>\n<h4>\u6587\u4ef6\u7684\u590d\u5236<\/h4>\n<p>\u5176\u5b9e\uff24\uff2f\uff33\u4e0b\u5c31\u6709\u4e00\u4e2a\u6587\u4ef6\u590d\u5236\u529f\u80fd\uff0c\u6bd4\u5982\u6211\u4eec\u60f3\u628a\uff44\u76d8\u4e0b\u9762\u7684\uff48\uff45\uff4c\uff4c\uff4f\uff0e\uff54\uff58\uff54\u6587\u4ef6\u590d\u5236\u5230d\u76d8\u4e0b\u9762\u7684rollen.txt\u6587\u4ef6\u4e2d\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n<p>copy d:\\hello.txt d:\\rollen.txt<\/p>\n<p>\u8fd0\u884c\u4e4b\u540e\u4f60\u4f1a\u5728d\u76d8\u4e2d\u770b\u89c1hello.txt.\uff0c\u5e76\u4e14\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u662f\u4e00\u6837\u7684\uff0c\uff08\u8fd9\u662f\u5c41\u8bdd\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u4f7f\u7528\u7a0b\u5e8f\u6765\u590d\u5236\u6587\u4ef6\u5427\u3002<\/p>\n<p>\u57fa\u672c\u601d\u8def\u8fd8\u662f\u4ece\u4e00\u4e2a\u6587\u4ef6\u4e2d\u8bfb\u5165\u5185\u5bb9\uff0c\u8fb9\u8bfb\u8fb9\u5199\u5165\u53e6\u4e00\u4e2a\u6587\u4ef6\uff0c\u5c31\u662f\u8fd9\u4e48\u7b80\u5355\u3002\u3001<\/p>\n<p>\u9996\u5148\u7f16\u5199\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u6587\u4ef6\u7684\u590d\u5236<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(args.length!=2){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u547d\u4ee4\u884c\u53c2\u6570\u8f93\u5165\u6709\u8bef\uff0c\u8bf7\u68c0\u67e5&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.exit(1);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file1=new File(args[0]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file2=new File(args[1]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!file1.exists()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u88ab\u590d\u5236\u7684\u6587\u4ef6\u4e0d\u5b58\u5728&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.exit(1);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input=new FileInputStream(file1);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream output=new FileOutputStream(file2);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if((input!=null)&amp;&amp;(output!=null)){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp=input.read())!=(-1)){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7136\u540e\u5728\u547d\u4ee4\u884c\u4e0b\u9762<\/p>\n<p>javac hello.java<\/p>\n<p>java hello d:\\hello.txt d:\\rollen.txt<\/p>\n<p>\u73b0\u5728\u4f60\u5c31\u4f1a\u5728d\u76d8\u770b\u5230rollen\u3002txt\u4e86\uff0c<\/p>\n<h4>OutputStreramWriter \u548cInputStreamReader\u7c7b<\/h4>\n<p>\u6574\u4e2aIO\u7c7b\u4e2d\u9664\u4e86\u5b57\u8282\u6d41\u548c\u5b57\u7b26\u6d41\u8fd8\u5305\u62ec\u5b57\u8282\u548c\u5b57\u7b26\u8f6c\u6362\u6d41\u3002<\/p>\n<p>OutputStreramWriter\u5c06\u8f93\u51fa\u7684\u5b57\u7b26\u6d41\u8f6c\u5316\u4e3a\u5b57\u8282\u6d41<\/p>\n<p>InputStreamReader\u5c06\u8f93\u5165\u7684\u5b57\u8282\u6d41\u8f6c\u6362\u4e3a\u5b57\u7b26\u6d41<\/p>\n<p>\u4f46\u662f\u4e0d\u7ba1\u5982\u4f55\u64cd\u4f5c\uff0c\u6700\u540e\u90fd\u662f\u4ee5\u5b57\u8282\u7684\u5f62\u5f0f\u4fdd\u5b58\u5728\u6587\u4ef6\u4e2d\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u5c06\u5b57\u8282\u8f93\u51fa\u6d41\u8f6c\u5316\u4e3a\u5b57\u7b26\u8f93\u51fa\u6d41<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5c06\u5b57\u8282\u8f93\u51fa\u6d41\u8f6c\u5316\u4e3a\u5b57\u7b26\u8f93\u51fa\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName= &#8220;d:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Writer out=new OutputStreamWriter(new FileOutputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(&#8220;hello&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a\u6587\u4ef6\u4e2d\u5185\u5bb9\u4e3a\uff1ahello<\/p>\n<h4>\u5c06\u5b57\u8282\u8f93\u5165\u6d41\u53d8\u4e3a\u5b57\u7b26\u8f93\u5165\u6d41<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5c06\u5b57\u8282\u8f93\u5165\u6d41\u53d8\u4e3a\u5b57\u7b26\u8f93\u5165\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String fileName= &#8220;d:&#8221;+File.separator+&#8221;hello.txt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file=new File(fileName);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Reader read=new InputStreamReader(new FileInputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char[] b=new char[100];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int len=read.read(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(new String(b,0,len));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0read.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1ahello<\/p>\n<p>\u524d\u9762\u5217\u4e3e\u7684\u8f93\u51fa\u8f93\u5165\u90fd\u662f\u4ee5\u6587\u4ef6\u8fdb\u884c\u7684\uff0c\u73b0\u5728\u6211\u4eec\u4ee5\u5185\u5bb9\u4e3a\u8f93\u51fa\u8f93\u5165\u76ee\u7684\u5730\uff0c\u4f7f\u7528\u5185\u5b58\u64cd\u4f5c\u6d41<\/p>\n<p>ByteArrayInputStream \u4e3b\u8981\u5c06\u5185\u5bb9\u5199\u5165\u5185\u5bb9<\/p>\n<p>ByteArrayOutputStream\u00a0 \u4e3b\u8981\u5c06\u5185\u5bb9\u4ece\u5185\u5b58\u8f93\u51fa<\/p>\n<h4>\u4f7f\u7528\u5185\u5b58\u64cd\u4f5c\u6d41\u5c06\u4e00\u4e2a\u5927\u5199\u5b57\u6bcd\u8f6c\u5316\u4e3a\u5c0f\u5199\u5b57\u6bcd<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528\u5185\u5b58\u64cd\u4f5c\u6d41\u5c06\u4e00\u4e2a\u5927\u5199\u5b57\u6bcd\u8f6c\u5316\u4e3a\u5c0f\u5199\u5b57\u6bcd<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str=&#8221;ROLLENHOLT&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ByteArrayInputStream input=new ByteArrayInputStream(str.getBytes());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ByteArrayOutputStream output=new ByteArrayOutputStream();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp=input.read())!=-1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char ch=(char)temp;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.write(Character.toLowerCase(ch));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String outStr=output.toString();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(outStr);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>rollenholt<\/p>\n<p>\u5185\u5bb9\u64cd\u4f5c\u6d41\u4e00\u822c\u4f7f\u7528\u6765\u751f\u6210\u4e00\u4e9b\u4e34\u65f6\u4fe1\u606f\u91c7\u7528\u7684\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5220\u9664\u7684\u9ebb\u70e6\u3002<\/p>\n<h4>\u7ba1\u9053\u6d41<\/h4>\n<p>\u7ba1\u9053\u6d41\u4e3b\u8981\u53ef\u4ee5\u8fdb\u884c\u4e24\u4e2a\u7ebf\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n<p>PipedOutputStream \u7ba1\u9053\u8f93\u51fa\u6d41<\/p>\n<p>PipedInputStream \u7ba1\u9053\u8f93\u5165\u6d41<\/p>\n<h6>\u9a8c\u8bc1\u7ba1\u9053\u6d41<\/h6>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">40<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">42<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">43<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">44<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">45<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">46<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">47<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">48<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">49<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">50<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">51<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">52<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">53<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">54<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">55<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">56<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">57<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">58<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">59<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">60<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">61<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">62<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">63<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">64<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">65<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">66<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">67<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">68<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">69<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">70<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">71<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">72<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">73<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u9a8c\u8bc1\u7ba1\u9053\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u6d88\u606f\u53d1\u9001\u7c7b<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class Send implements Runnable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private PipedOutputStream out=null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Send() {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out=new PipedOutputStream();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public PipedOutputStream getOut(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return this.out;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public void run(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String message=&#8221;hello , Rollen&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(message.getBytes());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u63a5\u53d7\u6d88\u606f\u7c7b<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class Recive implements Runnable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private PipedInputStream input=null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Recive(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.input=new PipedInputStream();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public PipedInputStream getInput(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return this.input;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public void run(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] b=new byte[1000];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int len=0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0len=this.input.read(b);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u63a5\u53d7\u7684\u5185\u5bb9\u4e3a &#8220;+(new String(b,0,len)));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u6d4b\u8bd5\u7c7b<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Send send=new Send();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Recive recive=new Recive();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/\/\u7ba1\u9053\u8fde\u63a5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0send.getOut().connect(recive.getInput());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0new Thread(send).start();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0new Thread(recive).start();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u63a5\u53d7\u7684\u5185\u5bb9\u4e3a hello , Rollen<\/p>\n<h4>\u6253\u5370\u6d41<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528PrintStream\u8fdb\u884c\u8f93\u51fa<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PrintStream print = new PrintStream(new FileOutputStream(new File(&#8220;d:&#8221;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0+ File.separator + &#8220;hello.txt&#8221;)));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print.println(true);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print.println(&#8220;Rollen&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>true<\/p>\n<p>Rollen<\/p>\n<p>\u5f53\u7136\u4e5f\u53ef\u4ee5\u683c\u5f0f\u5316\u8f93\u51fa<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528PrintStream\u8fdb\u884c\u8f93\u51fa<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5e76\u8fdb\u884c\u683c\u5f0f\u5316<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PrintStream print = new PrintStream(new FileOutputStream(new File(&#8220;d:&#8221;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0+ File.separator + &#8220;hello.txt&#8221;)));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String name=&#8221;Rollen&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int age=20;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print.printf(&#8220;\u59d3\u540d\uff1a%s. \u5e74\u9f84\uff1a%d.&#8221;,name,age);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u59d3\u540d\uff1aRollen. \u5e74\u9f84\uff1a20.<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528OutputStream\u5411\u5c4f\u5e55\u4e0a\u8f93\u51fa\u5185\u5bb9<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528OutputStream\u5411\u5c4f\u5e55\u4e0a\u8f93\u51fa\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class hello {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream out=System.out;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(&#8220;hello&#8221;.getBytes());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch (Exception e) {<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>hello<\/p>\n<p>&nbsp;<\/p>\n<h4>\u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileNotFoundException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.PrintStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4e3aSystem.out.println()\u91cd\u5b9a\u5411\u8f93\u51fa<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class systemDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u6b64\u523b\u76f4\u63a5\u8f93\u51fa\u5230\u5c4f\u5e55<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;hello&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.setOut(new PrintStream(new FileOutputStream(file)));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(FileNotFoundException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u8fd9\u4e9b\u5185\u5bb9\u5728\u6587\u4ef6\u4e2d\u624d\u80fd\u770b\u5230\u54e6\uff01&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>eclipse\u7684\u63a7\u5236\u53f0\u8f93\u51fa\u7684\u662fhello\u3002\u7136\u540e\u5f53\u6211\u4eec\u67e5\u770bd\u76d8\u4e0b\u9762\u7684hello.txt\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u4f1a\u5728\u91cc\u9762\u770b\u5230\uff1a\u8fd9\u4e9b\u5185\u5bb9\u5728\u6587\u4ef6\u4e2d\u624d\u80fd\u770b\u5230\u54e6\uff01<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileNotFoundException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.PrintStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* System.err\u91cd\u5b9a\u5411 \u8fd9\u4e2a\u4f8b\u5b50\u4e5f\u63d0\u793a\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u4fdd\u5b58\u9519\u8bef\u4fe1\u606f<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class systemErr{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.err.println(&#8220;\u8fd9\u4e9b\u5728\u63a7\u5236\u53f0\u8f93\u51fa&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.setErr(new PrintStream(new FileOutputStream(file)));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(FileNotFoundException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.err.println(&#8220;\u8fd9\u4e9b\u5728\u6587\u4ef6\u4e2d\u624d\u80fd\u770b\u5230\u54e6\uff01&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u4f60\u4f1a\u5728eclipse\u7684\u63a7\u5236\u53f0\u770b\u5230\u7ea2\u8272\u7684\u8f93\u51fa\uff1a\u201c\u8fd9\u4e9b\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u201d\uff0c\u7136\u540e\u5728d\u76d8\u4e0b\u9762\u7684hello.txt\u4e2d\u4f1a\u770b\u5230\uff1a\u8fd9\u4e9b\u5728\u6587\u4ef6\u4e2d\u624d\u80fd\u770b\u5230\u54e6\uff01<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileNotFoundException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* System.in\u91cd\u5b9a\u5411<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class systemIn{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!file.exists()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}else{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.setIn(new FileInputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(FileNotFoundException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] bytes = new byte[1024];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int len = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0len = System.in.read(bytes);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(IOException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u8bfb\u5165\u7684\u5185\u5bb9\u4e3a\uff1a&#8221; + new String(bytes, 0, len));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u524d\u63d0\u662f\u6211\u7684d\u76d8\u4e0b\u9762\u7684hello.txt\u4e2d\u7684\u5185\u5bb9\u662f\uff1a\u201c\u8fd9\u4e9b\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u54e6\uff01\u201d\uff0c\u7136\u540e\u8fd0\u884c\u7a0b\u5e8f\uff0c\u8f93\u51fa\u7684\u7ed3\u679c\u4e3a\uff1a\u8bfb\u5165\u7684\u5185\u5bb9\u4e3a\uff1a\u8fd9\u4e9b\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u54e6\uff01<\/p>\n<p>&nbsp;<\/p>\n<h4>BufferedReader\u7684\u5c0f\u4f8b\u5b50<\/h4>\n<p>\u6ce8\u610f\uff1a BufferedReader\u53ea\u80fd\u63a5\u53d7\u5b57\u7b26\u6d41\u7684\u7f13\u51b2\u533a\uff0c\u56e0\u4e3a\u6bcf\u4e00\u4e2a\u4e2d\u6587\u9700\u8981\u5360\u636e\u4e24\u4e2a\u5b57\u8282\uff0c\u6240\u4ee5\u9700\u8981\u5c06System.in\u8fd9\u4e2a\u5b57\u8282\u8f93\u5165\u6d41\u53d8\u4e3a\u5b57\u7b26\u8f93\u5165\u6d41\uff0c\u91c7\u7528\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">BufferedReader buf = new BufferedReader(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0new InputStreamReader(System.in));<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0b\u9762\u7ed9\u4e00\u4e2a\u5b9e\u4f8b\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.BufferedReader;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStreamReader;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4f7f\u7528\u7f13\u51b2\u533a\u4ece\u952e\u76d8\u4e0a\u8bfb\u5165\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class BufferedReaderDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0BufferedReader buf = new BufferedReader(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0new InputStreamReader(System.in));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u8bf7\u8f93\u5165\u5185\u5bb9&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0str = buf.readLine();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(IOException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u4f60\u8f93\u5165\u7684\u5185\u5bb9\u662f\uff1a&#8221; + str);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n<p>\u8bf7\u8f93\u5165\u5185\u5bb9<\/p>\n<p>dasdas<\/p>\n<p>\u4f60\u8f93\u5165\u7684\u5185\u5bb9\u662f\uff1adasdas<\/p>\n<p>&nbsp;<\/p>\n<h4>Scanner\u7c7b<\/h4>\n<p>\u5176\u5b9e\u6211\u4eec\u6bd4\u8f83\u5e38\u7528\u7684\u662f\u91c7\u7528Scanner\u7c7b\u6765\u8fdb\u884c\u6570\u636e\u8f93\u5165\uff0c\u4e0b\u9762\u6765\u7ed9\u4e00\u4e2aScanner\u7684\u4f8b\u5b50\u5427<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.Scanner;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* Scanner\u7684\u5c0f\u4f8b\u5b50\uff0c\u4ece\u952e\u76d8\u8bfb\u6570\u636e<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ScannerDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Scanner sca = new Scanner(System.in);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u8bfb\u4e00\u4e2a\u6574\u6570<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = sca.nextInt();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u8bfb\u53d6\u6d6e\u70b9\u6570<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0float flo=sca.nextFloat();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(flo);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u8bfb\u53d6\u5b57\u7b26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/&#8230;\u7b49\u7b49\u7684\uff0c\u90fd\u662f\u4e00\u4e9b\u592a\u57fa\u7840\u7684\uff0c\u5c31\u4e0d\u5e08\u8303\u4e86\u3002<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u5b9eScanner\u53ef\u4ee5\u63a5\u53d7\u4efb\u4f55\u7684\u8f93\u5165\u6d41<\/p>\n<p>\u4e0b\u9762\u7ed9\u4e00\u4e2a\u4f7f\u7528Scanner\u7c7b\u4ece\u6587\u4ef6\u4e2d\u8bfb\u51fa\u5185\u5bb9<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileNotFoundException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.Scanner;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* Scanner\u7684\u5c0f\u4f8b\u5b50\uff0c\u4ece\u6587\u4ef6\u4e2d\u8bfb\u5185\u5bb9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ScannerDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Scanner sca = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sca = new Scanner(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}catch(FileNotFoundException e){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str = sca.next();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u7684\u5185\u5bb9\u662f\uff1a&#8221; + str);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u7684\u5185\u5bb9\u662f\uff1a\u8fd9\u4e9b\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u54e6\uff01<\/p>\n<h4>\u6570\u636e\u64cd\u4f5c\u6d41DataOutputStream\u3001DataInputStream\u7c7b<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.DataOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class DataOutputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char[] ch = { &#8216;A&#8217;, &#8216;B&#8217;, &#8216;C&#8217; };<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DataOutputStream out = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out = new DataOutputStream(new FileOutputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for(char temp : ch){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeChar(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>A B C<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u5728\u4e0a\u9762\u4f8b\u5b50\u7684\u57fa\u7840\u4e0a\uff0c\u4f7f\u7528DataInputStream\u8bfb\u51fa\u5185\u5bb9<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.DataInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class DataOutputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DataInputStream input = new DataInputStream(new FileInputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char[] ch = new char[10];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int count = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0char temp;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = input.readChar()) != &#8216;C&#8217;){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ch[count++] = temp;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(ch);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>AB<\/p>\n<h4>\u5408\u5e76\u6d41 SequenceInputStream<\/h4>\n<p>SequenceInputStream\u4e3b\u8981\u7528\u6765\u5c062\u4e2a\u6d41\u5408\u5e76\u5728\u4e00\u8d77\uff0c\u6bd4\u5982\u5c06\u4e24\u4e2atxt\u4e2d\u7684\u5185\u5bb9\u5408\u5e76\u4e3a\u53e6\u5916\u4e00\u4e2atxt\u3002\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u5b9e\u4f8b\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.OutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.SequenceInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5c06\u4e24\u4e2a\u6587\u672c\u6587\u4ef6\u5408\u5e76\u4e3a\u53e6\u5916\u4e00\u4e2a\u6587\u672c\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class SequenceInputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file1 = new File(&#8220;d:&#8221; + File.separator + &#8220;hello1.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file2 = new File(&#8220;d:&#8221; + File.separator + &#8220;hello2.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file3 = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input1 = new FileInputStream(file1);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input2 = new FileInputStream(file2);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream output = new FileOutputStream(file3);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u5408\u5e76\u6d41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SequenceInputStream sis = new SequenceInputStream(input1, input2);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = sis.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input1.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input2.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sis.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u7ed3\u679c\u4f1a\u5728hello.txt\u6587\u4ef6\u4e2d\u5305\u542bhello1.txt\u548chello2.txt\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u3002<\/p>\n<h4>\u6587\u4ef6\u538b\u7f29 ZipOutputStream\u7c7b<\/h4>\n<p>\u5148\u4e3e\u4e00\u4e2a\u538b\u7f29\u5355\u4e2a\u6587\u4ef6\u7684\u4f8b\u5b50\u5427\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipEntry;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ZipOutputStreamDemo1{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File zipFile = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.zip&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input = new FileInputStream(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipFile));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.putNextEntry(new ZipEntry(file.getName()));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u8bbe\u7f6e\u6ce8\u91ca<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.setComment(&#8220;hello&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = input.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c\u4e4b\u524d\uff0c\u6211\u521b\u5efa\u4e86\u4e00\u4e2ahello.txt\u7684\u6587\u4ef6\uff0c\u539f\u672c\u5927\u5c0f56\u4e2a\u5b57\u8282\uff0c\u4f46\u662f\u538b\u7f29\u4e4b\u540e\u4ea7\u751fhello.zip\u4e4b\u540e\uff0c\u5c45\u7136\u53d8\u6210\u4e86175\u4e2a\u5b57\u8282\uff0c\u6709\u70b9\u641e\u4e0d\u61c2\u3002<\/p>\n<p>\u4e0d\u8fc7\u7ed3\u679c\u80af\u5b9a\u662f\u6b63\u786e\u7684\uff0c\u6211\u53ea\u662f\u63d0\u51fa\u6211\u7684\u4e00\u4e2a\u7591\u95ee\u800c\u5df2\u3002<\/p>\n<p>\u4e0a\u9762\u7684\u8fd9\u4e2a\u4f8b\u5b50\u6d4b\u8bd5\u7684\u662f\u538b\u7f29\u5355\u4e2a\u6587\u4ef6\uff0c\u4e0b\u9762\u7684\u4eec\u6765\u770b\u770b\u5982\u4f55\u538b\u7f29\u591a\u4e2a\u6587\u4ef6\u3002<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipEntry;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4e00\u6b21\u6027\u538b\u7f29\u591a\u4e2a\u6587\u4ef6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ZipOutputStreamDemo2{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u8981\u88ab\u538b\u7f29\u7684\u6587\u4ef6\u5939<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;temp&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File zipFile = new File(&#8220;d:&#8221; + File.separator + &#8220;zipFile.zip&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipFile));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.setComment(&#8220;hello&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(file.isDirectory()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File[] files = file.listFiles();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for(int i = 0; i &lt; files.length; ++i){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input = new FileInputStream(files[i]);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.putNextEntry(new ZipEntry(file.getName()<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0+ File.separator + files[i].getName()));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = input.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0zipOut.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u5148\u770b\u770b\u8981\u88ab\u538b\u7f29\u7684\u6587\u4ef6\u5427\uff1a<\/p>\n<p>\u63a5\u4e0b\u6765\u770b\u770b\u538b\u7f29\u4e4b\u540e\u7684\uff1a<\/p>\n<p>\u5927\u5bb6\u81ea\u7136\u60f3\u5230\uff0c\u65e2\u7136\u80fd\u538b\u7f29\uff0c\u81ea\u7136\u80fd\u89e3\u538b\u7f29\uff0c\u5728\u8c08\u89e3\u538b\u7f29\u4e4b\u524d\uff0c\u6211\u4eec\u4f1a\u7528\u5230\u4e00\u4e2aZipFile\u7c7b\uff0c\u5148\u7ed9\u4e00\u4e2a\u8fd9\u4e2a\u4f8b\u5b50\u5427\u3002java\u4e2d\u7684\u6bcf\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u90fd\u662f\u53ef\u4ee5\u4f7f\u7528ZipFile\u6765\u8fdb\u884c\u8868\u793a\u7684<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipFile;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* ZipFile\u6f14\u793a<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ZipFileDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.zip&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipFile zipFile = new ZipFile(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u538b\u7f29\u6587\u4ef6\u7684\u540d\u79f0\u4e3a\uff1a&#8221; + zipFile.getName());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u538b\u7f29\u6587\u4ef6\u7684\u540d\u79f0\u4e3a\uff1ad:\\hello.zip<\/p>\n<p>&nbsp;<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u5462\u662f\u65f6\u5019\u6765\u770b\u770b\u5982\u4f55\u52a0\u538b\u7f29\u6587\u4ef6\u4e86\uff0c\u548c\u4e4b\u524d\u4e00\u6837\uff0c\u5148\u8ba9\u6211\u4eec\u6765\u89e3\u538b\u5355\u4e2a\u538b\u7f29\u6587\u4ef6\uff08\u4e5f\u5c31\u662f\u538b\u7f29\u6587\u4ef6\u4e2d\u53ea\u6709\u4e00\u4e2a\u6587\u4ef6\u7684\u60c5\u51b5\uff09\uff0c\u6211\u4eec\u91c7\u7528\u524d\u9762\u7684\u4f8b\u5b50\u4ea7\u751f\u7684\u538b\u7f29\u6587\u4ef6hello.zip<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.OutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipEntry;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipFile;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u89e3\u538b\u7f29\u6587\u4ef6\uff08\u538b\u7f29\u6587\u4ef6\u4e2d\u53ea\u6709\u4e00\u4e2a\u6587\u4ef6\u7684\u60c5\u51b5\uff09<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ZipFileDemo2{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.zip&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File outFile = new File(&#8220;d:&#8221; + File.separator + &#8220;unZipFile.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipFile zipFile = new ZipFile(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipEntry entry = zipFile.getEntry(&#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input = zipFile.getInputStream(entry);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream output = new FileOutputStream(outFile);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = input.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u89e3\u538b\u7f29\u4e4b\u524d\uff1a<\/p>\n<p>\u8fd9\u4e2a\u538b\u7f29\u6587\u4ef6\u8fd8\u662f175\u5b57\u8282<\/p>\n<p>\u89e3\u538b\u4e4b\u540e\u4ea7\u751f\uff1a<\/p>\n<p>\u53c8\u56de\u5230\u4e8656\u5b57\u8282\uff0c\u8868\u793a\u90c1\u95f7\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u73b0\u5728\u8ba9\u6211\u4eec\u6765\u89e3\u538b\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u4e2d\u5305\u542b\u591a\u4e2a\u6587\u4ef6\u7684\u60c5\u51b5\u5427<\/p>\n<h4>ZipInputStream\u7c7b<\/h4>\n<p>\u5f53\u6211\u4eec\u9700\u8981\u89e3\u538b\u7f29\u591a\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\uff0cZipEntry\u5c31\u65e0\u6cd5\u4f7f\u7528\u4e86\uff0c\u5982\u679c\u60f3\u64cd\u4f5c\u66f4\u52a0\u590d\u6742\u7684\u538b\u7f29\u6587\u4ef6\uff0c\u6211\u4eec\u5c31\u5fc5\u987b\u4f7f\u7528ZipInputStream\u7c7b<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">40<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">42<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.InputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.OutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipEntry;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipFile;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.util.zip.ZipInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u89e3\u538b\u7f29\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u4e2d\u5305\u542b\u591a\u4e2a\u6587\u4ef6\u7684\u60c5\u51b5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ZipFileDemo3{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;zipFile.zip&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File outFile = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipFile zipFile = new ZipFile(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipInputStream zipInput = new ZipInputStream(new FileInputStream(file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZipEntry entry = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InputStream input = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream output = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((entry = zipInput.getNextEntry()) != null){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u89e3\u538b\u7f29&#8221; + entry.getName() + &#8220;\u6587\u4ef6&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0outFile = new File(&#8220;d:&#8221; + File.separator + entry.getName());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!outFile.getParentFile().exists()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0outFile.getParentFile().mkdir();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!outFile.exists()){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0outFile.createNewFile();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input = zipFile.getInputStream(entry);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output = new FileOutputStream(outFile);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = input.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.write(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0output.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u88ab\u89e3\u538b\u7684\u6587\u4ef6\uff1a<\/p>\n<p>\u89e3\u538b\u4e4b\u540e\u518dD\u76d8\u4e0b\u4f1a\u51fa\u73b0\u4e00\u4e2atemp\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5185\u5bb9\uff1a<\/p>\n<h4>PushBackInputStream\u56de\u9000\u6d41<\/h4>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ByteArrayInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.PushbackInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u56de\u9000\u6d41\u64cd\u4f5c<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class PushBackInputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String str = &#8220;hello,rollenholt&#8221;;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PushbackInputStream push = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ByteArrayInputStream bat = null;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0bat = new ByteArrayInputStream(str.getBytes());<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0push = new PushbackInputStream(bat);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int temp = 0;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0while((temp = push.read()) != -1){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(temp == &#8216;,&#8217;){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0push.unread(temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0temp = push.read();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.print(&#8220;(\u56de\u9000&#8221; + (char) temp + &#8220;) &#8220;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}else{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.print((char) temp);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>hello(\u56de\u9000,) rollenholt<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u53d6\u5f97\u672c\u5730\u7684\u9ed8\u8ba4\u7f16\u7801<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class CharSetDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;\u7cfb\u7edf\u9ed8\u8ba4\u7f16\u7801\u4e3a\uff1a&#8221; + System.getProperty(&#8220;file.encoding&#8221;));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u7cfb\u7edf\u9ed8\u8ba4\u7f16\u7801\u4e3a\uff1aGBK<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e71\u7801\u7684\u4ea7\u751f\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.OutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u4e71\u7801\u7684\u4ea7\u751f<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class CharSetDemo2{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OutputStream out = new FileOutputStream(file);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0byte[] bytes = &#8220;\u4f60\u597d&#8221;.getBytes(&#8220;ISO8859-1&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.write(bytes);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>??<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e00\u822c\u60c5\u51b5\u4e0b\u4ea7\u751f\u4e71\u7801\uff0c\u90fd\u662f\u7531\u4e8e\u7f16\u7801\u4e0d\u4e00\u81f4\u7684\u95ee\u9898\u3002<\/p>\n<h4>\u5bf9\u8c61\u7684\u5e8f\u5217\u5316<\/h4>\n<p>\u5bf9\u8c61\u5e8f\u5217\u5316\u5c31\u662f\u628a\u4e00\u4e2a\u5bf9\u8c61\u53d8\u4e3a\u4e8c\u8fdb\u5236\u6570\u636e\u6d41\u7684\u4e00\u79cd\u65b9\u6cd5\u3002<\/p>\n<p>\u4e00\u4e2a\u7c7b\u8981\u60f3\u88ab\u5e8f\u5217\u5316\uff0c\u5c31\u884c\u5fc5\u987b\u5b9e\u73b0java.io.Serializable\u63a5\u53e3\u3002\u867d\u7136\u8fd9\u4e2a\u63a5\u53e3\u4e2d\u6ca1\u6709\u4efb\u4f55\u65b9\u6cd5\uff0c\u5c31\u5982\u540c\u4e4b\u524d\u7684cloneable\u63a5\u53e3\u4e00\u6837\u3002\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3\u4e4b\u540e\uff0c\u5c31\u8868\u793a\u8fd9\u4e2a\u7c7b\u5177\u6709\u88ab\u5e8f\u5217\u5316\u7684\u80fd\u529b\u3002<\/p>\n<p>\u5148\u8ba9\u6211\u4eec\u5b9e\u73b0\u4e00\u4e2a\u5177\u6709\u5e8f\u5217\u5316\u80fd\u529b\u7684\u7c7b\u5427\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.*;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b9e\u73b0\u5177\u6709\u5e8f\u5217\u5316\u80fd\u529b\u7684\u7c7b<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class SerializableDemo implements Serializable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public SerializableDemo(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public SerializableDemo(String name, int age){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name=name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age=age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public String toString(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8220;\u59d3\u540d\uff1a&#8221;+name+&#8221;\u00a0 \u5e74\u9f84\uff1a&#8221;+age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private String name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private int age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e2a\u7c7b\u5c31\u5177\u6709\u5b9e\u73b0\u5e8f\u5217\u5316\u80fd\u529b\uff0c<\/p>\n<h4>\u5728\u7ee7\u7eed\u5c06\u5e8f\u5217\u5316\u4e4b\u524d\uff0c\u5148\u5c06\u4e00\u4e0bObjectInputStream\u548cObjectOutputStream\u8fd9\u4e24\u4e2a\u7c7b<\/h4>\n<p>\u5148\u7ed9\u4e00\u4e2aObjectOutputStream\u7684\u4f8b\u5b50\u5427\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.Serializable;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5b9e\u73b0\u5177\u6709\u5e8f\u5217\u5316\u80fd\u529b\u7684\u7c7b<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class Person implements Serializable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person(String name, int age){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name = name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age = age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public String toString(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8220;\u59d3\u540d\uff1a&#8221; + name + &#8221;\u00a0 \u5e74\u9f84\uff1a&#8221; + age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private String name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private int age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u793a\u8303ObjectOutputStream<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ObjectOutputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0oos.writeObject(new Person(&#8220;rollen&#8221;, 20));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0oos.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u5f53\u6211\u4eec\u67e5\u770b\u4ea7\u751f\u7684hello.txt\u7684\u65f6\u5019\uff0c\u770b\u5230\u7684\u662f\u4e71\u7801\uff0c\u5475\u5475\u3002\u56e0\u4e3a\u662f\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<p>\u867d\u7136\u6211\u4eec\u4e0d\u80fd\u76f4\u63a5\u67e5\u770b\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Object\uff29\uff4e\uff50\uff55\uff54\uff33\uff54\uff52\uff45\uff41\uff4d\u7c7b\u67e5\u770b\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* ObjectInputStream\u793a\u8303<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ObjectInputStreamDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInputStream input = new ObjectInputStream(new FileInputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object obj = input.readObject();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(obj);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011<\/p>\n<p>\u59d3\u540d\uff1arollen\u00a0 \u5e74\u9f84\uff1a20<\/p>\n<p>&nbsp;<\/p>\n<p>\u5230\u5e95\u5e8f\u5217\u5316\u4ec0\u4e48\u5185\u5bb9\u5462\uff1f<\/p>\n<p>\u5176\u5b9e\u53ea\u6709\u5c5e\u6027\u4f1a\u88ab\u5e8f\u5217\u5316\u3002<\/p>\n<h4>Externalizable\u63a5\u53e3<\/h4>\n<p>\u88abSerializable\u63a5\u53e3\u58f0\u660e\u7684\u7c7b\u7684\u5bf9\u8c61\u7684\u5c5e\u6027\u90fd\u5c06\u88ab\u5e8f\u5217\u5316\uff0c\u4f46\u662f\u5982\u679c\u60f3\u81ea\u5b9a\u4e49\u5e8f\u5217\u5316\u7684\u5185\u5bb9\u7684\u65f6\u5019\uff0c\u5c31\u9700\u8981\u5b9e\u73b0Externalizable\u63a5\u53e3\u3002<\/p>\n<p>\u5f53\u4e00\u4e2a\u7c7b\u8981\u4f7f\u7528Externalizable\u8fd9\u4e2a\u63a5\u53e3\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u7c7b\u4e2d\u5fc5\u987b\u8981\u6709\u4e00\u4e2a\u65e0\u53c2\u7684\u6784\u9020\u51fd\u6570\uff0c\u5982\u679c\u6ca1\u6709\u7684\u8bdd\uff0c\u5728\u6784\u9020\u7684\u65f6\u5019\u4f1a\u4ea7\u751f\u5f02\u5e38\uff0c\u8fd9\u662f\u56e0\u4e3a\u5728\u53cd\u5e8f\u5217\u8bdd\u7684\u65f6\u5019\u4f1a\u9ed8\u8ba4\u8c03\u7528\u65e0\u53c2\u7684\u6784\u9020\u51fd\u6570\u3002<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u6f14\u793a\u4e00\u4e0b\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u8bdd\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">40<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">42<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">43<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">44<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">45<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">46<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">47<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">48<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">49<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">50<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">51<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">52<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">53<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">54<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">55<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">56<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">57<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">58<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">59<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">60<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">61<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">62<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">63<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">64<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">65<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">66<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">67<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">68<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">69<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">70<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">71<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">72<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">package IO;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.Externalizable;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.IOException;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectInput;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectOutput;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7684\u64cd\u4f5c<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class ExternalizableDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ser(); \/\/ \u5e8f\u5217\u5316<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dser(); \/\/ \u53cd\u5e8f\u5217\u8bdd<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void ser() throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeObject(new Person(&#8220;rollen&#8221;, 20));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void dser() throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInputStream input = new ObjectInputStream(new FileInputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object obj = input.readObject();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(obj);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class Person implements Externalizable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person(String name, int age){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name = name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age = age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public String toString(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8220;\u59d3\u540d\uff1a&#8221; + name + &#8221;\u00a0 \u5e74\u9f84\uff1a&#8221; + age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u590d\u5199\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u6839\u636e\u9700\u8981\u53ef\u4ee5\u4fdd\u5b58\u7684\u5c5e\u6027\u6216\u8005\u5177\u4f53\u5185\u5bb9\uff0c\u5728\u5e8f\u5217\u5316\u7684\u65f6\u5019\u4f7f\u7528<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public void writeExternal(ObjectOutput out) throws IOException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeObject(this.name);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeInt(age);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u590d\u5199\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u6839\u636e\u9700\u8981\u8bfb\u53d6\u5185\u5bb9 \u53cd\u5e8f\u5217\u8bdd\u7684\u65f6\u5019\u9700\u8981<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public void readExternal(ObjectInput in) throws IOException,<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ClassNotFoundException{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name = (String) in.readObject();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age = in.readInt();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private String name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private int age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u59d3\u540d\uff1arollen\u00a0 \u5e74\u9f84\uff1a20<\/p>\n<p>\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u5c06\u5168\u90e8\u7684\u5c5e\u6027\u90fd\u4fdd\u7559\u4e86\u4e0b\u6765\uff0c<\/p>\n<p>Serializable\u63a5\u53e3\u5b9e\u73b0\u7684\u64cd\u4f5c\u5176\u5b9e\u662f\u5427\u4e00\u4e2a\u5bf9\u8c61\u4e2d\u7684\u5168\u90e8\u5c5e\u6027\u8fdb\u884c\u5e8f\u5217\u5316\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528\u6211\u4eec\u4e0a\u4f7f\u7528\u662fExternalizable\u63a5\u53e3\u4ee5\u5b9e\u73b0\u90e8\u5206\u5c5e\u6027\u7684\u5e8f\u5217\u5316\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u64cd\u4f5c\u6bd4\u8f83\u9ebb\u70e6\uff0c<\/p>\n<p>\u5f53\u6211\u4eec\u4f7f\u7528Serializable\u63a5\u53e3\u5b9e\u73b0\u5e8f\u5217\u5316\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u5982\u679c\u4e00\u4e2a\u5bf9\u8c61\u7684\u67d0\u4e00\u4e2a\u5c5e\u6027\u4e0d\u60f3\u88ab\u5e8f\u5217\u5316\u4fdd\u5b58\u4e0b\u6765\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528transient\u5173\u952e\u5b57\u8fdb\u884c\u8bf4\u660e\uff1a<\/p>\n<p>\u4e0b\u9762\u4e3e\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">40<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">42<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">43<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">44<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">45<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">46<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">47<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">48<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">49<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">50<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">51<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">52<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">53<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">54<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">55<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">package IO;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.Serializable;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7684\u64cd\u4f5c<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class serDemo{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ser(); \/\/ \u5e8f\u5217\u5316<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dser(); \/\/ \u53cd\u5e8f\u5217\u8bdd<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void ser() throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeObject(new Person1(&#8220;rollen&#8221;, 20));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void dser() throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInputStream input = new ObjectInputStream(new FileInputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object obj = input.readObject();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(obj);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class Person1 implements Serializable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person1(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Person1(String name, int age){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name = name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age = age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public String toString(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8220;\u59d3\u540d\uff1a&#8221; + name + &#8221;\u00a0 \u5e74\u9f84\uff1a&#8221; + age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u6ce8\u610f\u8fd9\u91cc<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private transient String name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private int age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u59d3\u540d\uff1anull\u00a0 \u5e74\u9f84\uff1a20<\/p>\n<p>\u6700\u540e\u5728\u7ed9\u4e00\u4e2a\u5e8f\u5217\u5316\u4e00\u7ec4\u5bf9\u8c61\u7684\u4f8b\u5b50\u5427\uff1a<\/p>\n<table style=\"font-weight: normal !important; font-style: normal !important;\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">1<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">2<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">3<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">4<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">5<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">6<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">7<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">8<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">9<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">10<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">11<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">12<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">13<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">14<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">15<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">16<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">17<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">18<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">19<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">20<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">21<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">22<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">23<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">24<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">25<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">26<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">27<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">28<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">29<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">30<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">31<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">32<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">33<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">34<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">35<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">36<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">37<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">38<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">39<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">40<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">41<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">42<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">43<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">44<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">45<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">46<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">47<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">48<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">49<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">50<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">51<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">52<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">53<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">54<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">55<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">56<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">57<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">58<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">59<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">60<\/p>\n<\/td>\n<td style=\"font-weight: normal !important; font-style: normal !important;\">\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.File;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.FileOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectInputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.ObjectOutputStream;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">import java.io.Serializable;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\/**<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* \u5e8f\u5217\u5316\u4e00\u7ec4\u5bf9\u8c61<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0* *\/<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">public class SerDemo1{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void main(String[] args) throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Student[] stu = { new Student(&#8220;hello&#8221;, 20), new Student(&#8220;world&#8221;, 30),<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0new Student(&#8220;rollen&#8221;, 40) };<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ser(stu);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object[] obj = dser();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for(int i = 0; i &lt; obj.length; ++i){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Student s = (Student) obj[i];<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(s);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u5e8f\u5217\u5316<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static void ser(Object[] obj) throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.writeObject(obj);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0out.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u53cd\u5e8f\u5217\u5316<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public static Object[] dser() throws Exception{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0File file = new File(&#8220;d:&#8221; + File.separator + &#8220;hello.txt&#8221;);<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInputStream input = new ObjectInputStream(new FileInputStream(<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file));<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object[] obj = (Object[]) input.readObject();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0input.close();<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return obj;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">class Student implements Serializable{<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Student(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public Student(String name, int age){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.name = name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.age = age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0@Override<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0public String toString(){<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8220;\u59d3\u540d\uff1a\u00a0 &#8221; + name + &#8221;\u00a0 \u5e74\u9f84\uff1a&#8221; + age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private String name;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">\u00a0\u00a0\u00a0\u00a0private int age;<\/p>\n<p style=\"font-weight: normal !important; font-style: normal !important;\">}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3010\u8fd0\u884c\u7ed3\u679c\u3011\uff1a<\/p>\n<p>\u59d3\u540d\uff1a\u00a0 hello\u00a0 \u5e74\u9f84\uff1a20<\/p>\n<p>\u59d3\u540d\uff1a\u00a0 world\u00a0 \u5e74\u9f84\uff1a30<\/p>\n<p>\u59d3\u540d\uff1a\u00a0 rollen\u00a0 \u5e74\u9f84\uff1a40<\/p>\n<p>&nbsp;<\/p>\n<h4>\u5199\u5728\u6700\u540e\uff1a\u672c\u6587\u7ae0\u6ca1\u6709\u6d89\u53cajava.nio\uff0c\u7b49\u6211\u6709\u65f6\u95f4\uff0c\u6211\u81ea\u4f1a\u8865\u4e0a\u7684\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u6211\u7684\u535a\u5ba2\uff0c\u5927\u5bb6\u4e00\u8d77\u4ea4\u6d41\u5b66\u4e60\u3002<\/h4>\n<p>&nbsp;<\/p>\n<p>\u539f\u6587\u51fa\u5904\uff1a <a href=\"http:\/\/www.cnblogs.com\/rollenholt\/archive\/2011\/09\/11\/2173787.html\" target=\"_blank\">rollenholt<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5199\u5728\u524d\u9762\uff1a\u672c\u6587\u7ae0\u57fa\u672c\u8986\u76d6\u4e86java IO\u7684\u5168\u90e8\u5185\u5bb9\uff0cjava\u65b0IO\u6ca1\u6709\u6d89\u53ca\uff0c\u56e0\u4e3a\u6211\u60f3\u548c\u8fd9\u4e2a\u5206\u5f00\uff0c\u4ee5\u7a81\u51fa\u90a3\u4e2a\u7684\u91cd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22],"tags":[41],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1270"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1270"}],"version-history":[{"count":8,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1270\/revisions"}],"predecessor-version":[{"id":1273,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1270\/revisions\/1273"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}