Java IOѧϰ±Ê¼Ç£º×Ö·ûÁ÷
Java IOѧϰ±Ê¼Ç£º×Ö·ûÁ÷
×Ö·ûÁ÷µÄ´¦ÀíºÍ×Ö½ÚÁ÷²î²»¶à£¬API»ù±¾ÉÏÍêȫһÑù£¬¾ÍÊǼÆÁ¿µ¥Î»²»Í¬¡£ÁíÍâ×Ö·ûÁ÷»¹ÌṩһЩÆäËûµÄ´¦ÀíÁ÷£¬±ÈÈç°´ÐжÁÈ¡Á÷¡¢×Ö·û´®Á÷µÈµÈ¡£
ÏÂÃæ¸ø¸öÀý×Ó¿´¿´£º
import java.io.*;
/**
* ×Ö·ûÁ÷²âÊÔ
*
* @author leizhimin 2008-8-27 22:16:44
*/
public class TestIOStream {
public static void main(String[] args) {
testReaderWriter();
testLineNumberReader();
}
/**
* ´ø»º³åµÄ×Ö·ûÁ÷
*/
public static void testReaderWriter() {
int bufsize = 25;
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(new File("C:\\x.txt")));
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(new File("C:\\xb.txt")));
char buf[] = new char[bufsize]; //×Ö·û»º³åÇø
while (bufferedReader.read(buf) != -1) {
bufferedWriter.write(buf);
}
bufferedWriter.flush();
bufferedReader.close();
bufferedWriter.close();
} catch (FileN
Ïà¹ØÎĵµ£º
JavaÏß³ÌÊÇJavaÓïÑÔÖÐÒ»¸ö·Ç³£ÖØÒªµÄ²¿·Ö£¬Java5֮ǰ£¬¶àÏ̵߳ÄÓïÑÔÖ§³Ö»¹ÊDZȽÏÈõµÄ£¬ÄÚÈÝÒ²½ÏÉÙ£¬Ð´Ò»¸ö¸´ÔӵĶàÏ̳߳ÌÐòÊÇÏ൱ÓÐÌôÕ½ÐԵġ£
ÔÚJava5ÒÔºó£¬Java¶Ô¶àÏß³Ì×öÁ˺ܶàÀ©Õ¹£¬À©Õ¹²¿·Ö³ÆÖ®Îª²¢·¢°ü¡£Õⲿ·ÖÄÚÈÝ´ó´óÔöÇ¿ÁËJava¶àÏ̱߳à³ÌµÄÄÜÁ¦£¬Í¨¹ýʹÓÃJava5Ïß³ÌÐÂÌØÕ÷µÄAPI£¬¿ÉÒÔºÜÈÝÒ×µÄ×ö³ö¸´Ô ......
»ùÓÚjavaµÄÆóÒµËÑË÷ÒýÇæÓÅ»¯ÄÚÈݹÜÀíϵͳ
»ùÓÚJavaµÄÆóÒµËÑË÷ÒýÇæÓÅ»¯ÄÚÈݹÜÀíϵͳ(SEO-ECMS-v1.0)ÏîĿ˵Ã÷£º
ÍøÂçÉÏÁ÷´«µÄÆóÒµÍøÕ¾¹ÜÀíϵͳ´ó¶¼ºöÂÔÁËÒ»µã¼´Ã¿¸öÒ³ÃæµÄ Ò³Ãæ±êÌâ Ò³Ãæ¹Ø¼ü×Ö Ò³ÃæÃèÊöµÄÉèÖá£
¶øÕâЩǡǡÊÇËÑË÷ÒýÇæ×î¹ØÐĵĶ«Î÷¡£ÔÚ´ÓÊÂseoµÄÅóÓѵİïÖúÏ£¬¿ª·¢ÁËÕâÌ×ÊʺÏseoµÄcms¡£
ÏîÄ¿²ÉÓÃÎȶ¨ÇÒÁé» ......
Java IOѧϰ±Ê¼Ç£º×Ö½ÚÁ÷
×Ö½ÚÁ÷ÊÇ×î»ù±¾µÄÁ÷£¬ÎļþµÄ²Ù×÷¡¢ÍøÂçÊý¾ÝµÄ´«ÊäµÈµÈ¶¼ÒÀÀµÓÚ×Ö½ÚÁ÷¡£¶ø×Ö·ûÁ÷³£³£ÓÃÓÚ¶ÁÈ¡Îı¾ÀàÐ͵ÄÊý¾Ý»ò×Ö·û´®Á÷µÄ²Ù×÷µÈµÈ¡£
¹ØÓÚ×Ö½ÚÁ÷µÄAPI£¬Ã»Ê²Ã´ºÃ˵µÄ£¬¿´¿´¾ÍÖªµÀÁË¡£ÕâÀïÌô¼¸¸ö¹Ø¼üµã£º
Ò»¡¢InputStreamµÄAPI
1¡¢public int read()
´ÓÊäÈëÁ÷¶ÁÈ¡ÏÂÒ»¸ö ......