dz̸JavaµÄÊäÈëÊä³öÁ÷
JavaÓïÑÔµÄÊäÈëÊä³ö¹¦ÄÜÊÇÊ®·ÖÇ¿´ó¶øÁé»îµÄ£¬ÃÀÖв»×ãµÄÊÇ¿´ÉÏÈ¥ÊäÈëÊä³öµÄ´úÂë²¢²»ÊǺܼò½à£¬ÒòΪÄãÍùÍùÐèÒª°ü×°Ðí¶à²»Í¬µÄ¶ÔÏó¡£ÔÚJavaÀà¿âÖУ¬IO²¿·ÖµÄÄÚÈÝÊǺÜÅÓ´óµÄ£¬ÒòΪËüÉæ¼°µÄÁìÓòºÜ¹ã·º:±ê×¼ÊäÈëÊä³ö£¬ÎļþµÄ²Ù×÷£¬ÍøÂçÉϵÄÊý¾ÝÁ÷£¬×Ö·û´®Á÷£¬¶ÔÏóÁ÷£¬zipÎļþÁ÷....±¾ÎĵÄÄ¿µÄÊÇΪ´ó¼Ò×öÒ»¸ö¼òÒªµÄ½éÉÜ¡£
¡¡¡¡Á÷ÊÇÒ»¸öºÜÐÎÏóµÄ¸ÅÄµ±³ÌÐòÐèÒª¶ÁÈ¡Êý¾ÝµÄʱºò£¬¾Í»á¿ªÆôÒ»¸öͨÏòÊý¾ÝÔ´µÄÁ÷£¬Õâ¸öÊý¾ÝÔ´¿ÉÒÔÊÇÎļþ£¬Äڴ棬»òÊÇÍøÂçÁ¬½Ó¡£ÀàËƵģ¬µ±³ÌÐòÐèҪдÈëÊý¾ÝµÄʱºò£¬¾Í»á¿ªÆôÒ»¸öͨÏòÄ¿µÄµØµÄÁ÷¡£ÕâʱºòÄã¾Í¿ÉÒÔÏëÏóÊý¾ÝºÃÏñÔÚÕâÆäÖГÁ÷”¶¯Ò»Ñù£¬ÈçÏÂͼ£º
¡¡¡¡JavaÖеÄÁ÷·ÖΪÁ½ÖÖ£¬Ò»ÖÖÊÇ×Ö½ÚÁ÷£¬ÁíÒ»ÖÖÊÇ×Ö·ûÁ÷£¬·Ö±ðÓÉËĸö³éÏóÀàÀ´±íʾ£¨Ã¿ÖÖÁ÷°üÀ¨ÊäÈëºÍÊä³öÁ½ÖÖËùÒÔÒ»¹²Ëĸö£©:InputStream£¬OutputStream£¬Reader£¬Writer¡£JavaÖÐÆäËû¶àÖÖ¶àÑù±ä»¯µÄÁ÷¾ùÊÇÓÉËüÃÇÅÉÉú³öÀ´µÄ:
¡¡¡¡ÔÚÕâÆäÖÐInputStreamºÍOutputStreamÔÚÔçÆÚµÄJava°æ±¾ÖоÍÒѾ´æÔÚÁË£¬ËüÃÇÊÇ»ùÓÚ×Ö½ÚÁ÷µÄ£¬¶ø»ùÓÚ×Ö·ûÁ÷µÄReaderºÍWriterÊǺóÀ´¼ÓÈë×÷Ϊ²¹³äµÄ¡£ÒÔÉϵIJã´ÎͼÊÇJavaÀà¿âÖеÄÒ»¸ö»ù±¾µÄ²ã´ÎÌåϵ¡£
¡¡¡¡ÔÚÕâËĸö³éÏóÀàÖУ¬InputStreamºÍReader¶¨ÒåÁËÍêÈ«ÏàͬµÄ½Ó¿Ú£º
int read£¨£©
int read£¨char cbuf[]£©
int read£¨char cbuf[], int offset, int length£©
¡¡¡¡¶øOutputStreamºÍWriterÒ²ÊÇÈç´Ë£º
int write£¨int c£©
int write£¨char cbuf[]£©
int write£¨char cbuf[], int offset, int length£©
¡¡¡¡ÕâÁù¸ö·½·¨¶¼ÊÇ×î»ù±¾µÄ£¬read£¨£©ºÍwrite£¨£©Í¨¹ý·½·¨µÄÖØÔØÀ´¶Áдһ¸ö×Ö½Ú£¬»òÕßÒ»¸ö×Ö½ÚÊý×é¡£
¡¡¡¡¸ü¶àÁé»î¶à±äµÄ¹¦ÄÜÊÇÓÉËüÃǵÄ×ÓÀàÀ´À©³äÍê³ÉµÄ¡£ÖªµÀÁËJavaÊäÈëÊä³öµÄ»ù±¾²ã´Î½á¹¹ÒԺ󣬱¾ÎÄÔÚÕâÀïÏë¸ø´ó¼ÒһЩÒÔºó¿ÉÒÔ·´¸´Ó¦ÓÃÀý×Ó£¬¶ÔÓÚËùÓÐ×ÓÀàµÄϸ½Ú¼°Æ书Äܲ¢²»ÏêϸÌÖÂÛ¡£
import java.io.*£»
public class IOStreamDemo {
public void samples£¨£© throws IOException {
//1. ÕâÊÇ´Ó¼üÅ̶ÁÈëÒ»ÐÐÊý¾Ý,·µ»ØµÄÊÇÒ»¸ö×Ö·û´®
BufferedReader stdin =new BufferedReader£¨new InputStreamReader£¨System.in£©£©£»
System.out.print£¨"Enter a line:"
Ïà¹ØÎĵµ£º
ÕâÀJavaµÄ¶ÁÎļþºÍдÎļþ¶¼ÊÇ»ùÓÚ×Ö·ûÁ÷µÄ£¬Ö÷ÒªÓõ½ÏÂÃæµÄ¼¸¸öÀࣺ
1¡¢FileReader----¶ÁÈ¡×Ö·ûÁ÷
2¡¢FileWriter----дÈë×Ö·ûÁ÷
3¡¢BufferedReader----»º³åÖ¸¶¨ÎļþµÄÊäÈë
¸ÃÀàµÄ·½·¨ÓУº
void close()
¹Ø±Õ¸ÃÁ÷¡£
void mark(int readAhead ......
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖУ¬ ......
ת×Ôhttp://www.cnblogs.com/liwp_stephen/archive/2008/08/03/1259385.html£¬·Ç³£¸Ðл×÷ÕߵķÖÏí
ʹÓÃAxis±àдWebService±È½Ï¼òµ¥£¬¾ÍÎÒµÄÀí½â£¬WebServiceµÄʵÏÖ´úÂëºÍ±àдJava´úÂëÆäʵûÓÐʲôÇø±ð£¬Ö÷ÒªÊǽ«ÄÄЩJavaÀà·¢²¼ÎªWebService¡£ÏÂÃæÊÇÒ»¸ö´Ó±àд²âÊÔÀý× ......
ÍƼöÒ»¸ö¾ø¶Ô¾µäµÄÊÓƵ£¬²»ºÃµÄÄÃשÅÄÎÒ°¡
ÎÞÒâÖÐÔÚÍøÉÏÏÂÔص½Ò»Ì×ÊÓƵ£¬ÒѾȫ³ÌÌýÍ꣬¸Ð¾õ·Ç³£²»´í¡£´ÓJava»ù´¡¿ªÊ¼ÑÐò½¥½ø£¬ÓÉdzÈëÉÊÓƵÖв»½ö¾«
±ÙµÄ½²½âÁËJava¿ª·¢µÄ֪ʶ£¬¶øÇÒÈÚÈëÁ˺ܶàѧϰ·½·¨µÄ½²½âºÍ±à³Ì˼ÏëµÄÒýµ¼£¬×ÛºÏÀ´Ëµ¿ÉÒÔÈË¿°³ÆÈëÃŵľµäÖ®
×÷!
ÌرðÍƼö¸ø´ó¼Ò£¬´ó¼Ò¹²Í¬½ø²½¡£°ÑÍøÖ·¸ø´ ......