java¶ÁдÎļþ_IO
ʹÓÃJava²Ù×÷Îı¾ÎļþµÄ·½·¨Ïê½â
ÕªÒª: ×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀà
×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀ࣬ÕâÁ½¸öÀ඼ÊdzéÏóÀ࣬WriterÖÐ write(char[] ch£¬int off£¬int length)£¬flush()ºÍclose()·½·¨Îª³éÏó·½·¨£¬ReaderÖÐread(char[] ch£¬int off£¬int length)ºÍclose()·½·¨ÊdzéÏó·½·¨¡£×ÓÀàÓ¦¸Ã·Ö±ðʵÏÖËûÃÇ¡£
¡¡¡¡µ±ÎÒÃǶÁдÎı¾ÎļþµÄʱºò£¬²ÉÓÃReaderÊǷdz£·½±ãµÄ£¬±ÈÈçFileReader£¬InputStreamReaderºÍBufferedReader¡£ÆäÖÐ×îÖØÒªµÄÀàÊÇInputStreamReader£¬ËüÊÇ×Ö½Úת»»Îª×Ö·ûµÄÇÅÁº¡£Äã¿ÉÒÔÔÚ¹¹ÔìÆ÷ÖØÖ¸¶¨±àÂëµÄ·½Ê½£¬Èç¹û²»Ö¸¶¨µÄ»°½«²ÉÓõײã²Ù×÷ϵͳµÄĬÈϱàÂ뷽ʽ£¬ÀýÈçGBK£¨ÔÛÃǵÄÖÐÎÄwindowsĬÈÏ£©µÈ¡£µ±Ê¹ÓÃFileReader¶ÁÈ¡ÎļþµÄʱºò¡£
¾ÍºÃÏñÒ»¸ù¹Ü×Ó²å½øÈ¥¿ªÊ¼¶ÁÊý¾Ý»òÕßдÊý¾Ý£¬ÕâÊÇ×Ö½ÚÁ÷£¨Input/Output StreamReader£©£¬¹Ü×ÓÍâÃæÔÙÌ׸ú¹Ü×Óת»»Îª×Ö·ûÁ÷£¬¶ÁÈ¡¸üΪ·½±ã¡£
FileReader fr = new FileReader("ming.txt");
int ch = 0;
while((ch = fr.read()) != -1 ){
System.out.print((char)ch);
}
ÆäÖÐread()·½·¨·µ»ØµÄÊǶÁÈ¡µÃϸö×Ö·û¡£µ±È»ÄãÒ²¿ÉÒÔʹÓÃread(char[] ch£¬int off£¬int length)ÕâºÍ´¦Àí¶þ½øÖÆÎļþµÄʱºòÀàËÆ£¬²»¶à˵ÁË¡£Èç¹ûʹÓÃInputStreamReaderÀ´¶ÁÈ¡ÎļþµÄʱºò
while((ch = isr.read())!=-1){
System.out.print((char)ch);
}
ÕâºÍFileReader²¢Ã»ÓÐʲôÇø±ð£¬ÊÂʵÉÏÔÚFileReaderÖеķ½·¨¶¼ÊÇ´ÓInputStreamReaderÖм̳йýÀ´µÄ¡£read()·½·¨ÊDZȽϷÑʱ¼äµÄ£¬Èç¹ûΪÁËÌá¸ßЧÂÊÎÒÃÇ¿ÉÒÔʹÓÃBufferedReader¶ÔReader½øÐаü×°£¬Í¬Ê±Ò²Îª±£»¤ÎÒÃǵÄÓ²ÅÌ£¬£¨Buffer »º³å£©ÕâÑù¿ÉÒÔÌá¸ß¶ÁÈ¡µÃËٶȣ¬ÎÒÃÇ¿ÉÒÔÒ»ÐÐÒ»ÐеĶÁÈ¡Îı¾£¬Ê¹ÓÃreadLine()·½·¨¡£
BufferedReader br = new BufferedReader(new InputStreamReader(new Fil
Ïà¹ØÎĵµ£º
package zzq.main;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
/************************************************************************
* CÓïÑÔȤζ³ÌÐò£¨²»µ½£©°ÙÀý-Ö®JavaʵÏÖ
*
* 0 ......
javaµÄRuntime.getRuntime().exec(commandStr)¿ÉÒÔµ÷ÓÃÖ´ÐÐcmdÖ¸Áî¡£
cmd /c xxÊÇÖ´ÐÐÍêxxÃüÁîºó¹Ø±ÕÃüÁî´°¿Ú¡£
cmd /k xxÊÇÖ´ÐÐÍêxxÃüÁîºó²»¹Ø±ÕÃüÁî´°¿Ú¡£
cmd /c start xx»á´ò¿ªÒ»¸öд°¿ÚºóÖ´ÐÐxxÖ¸ÁԴ°¿Ú»á¹Ø±Õ¡£
cmd /k start xx»á´ò¿ªÒ»¸öд°¿ÚºóÖ´ÐÐxxÖ¸ÁԴ°¿Ú²»»á¹Ø±Õ¡£
¿ÉÒÔÓÃcmd /?²é¿´°ïÖúÐÅÏ¢¡£ ......
package com.mywebtest.common;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Java reflection ·Ç³£ÓÐÓã¬ËüʹÀàºÍÊý¾Ý½á¹¹ÄÜ°´Ãû³Æ¶¯Ì¬¼ìË÷Ïà¹ØÐÅÏ¢£¬²¢ÔÊÐíÔÚÔËÐÐ× ......
ÏÈÀ´¿´¿´¿Í»§¶Î³ÌÐò±àдµÄÁ÷³Ì:
¡¡¡¡1¡¢ Ê×Ïȵ÷ÓÃSocketÀàµÄ¹¹Ô캯Êý£¬ÒÔ·þÎñÆ÷µÄÖ¸¶¨µÄIPµØÖ·»òÖ¸¶¨µÄÖ÷»úÃûºÍÖ¸¶¨µÄ¶Ë¿ÚºÅΪ²ÎÊý£¬´´½¨Ò»¸öSocketÁ÷£¬ÔÚ´´½¨SocketÁ÷µÄ¹ý³ÌÖаüº¬ÁËÏò·þÎñÆ÷ÇëÇó½¨Á¢Í¨Ñ¶Á¬½ÓµÄ¹ý³ÌʵÏÖ¡£
¡¡¡¡2¡¢ ½¨Á¢ÁË¿Í»§¶ËͨѶSocketºó¡£¾Í¿ÉÒÔʹÓÃSocketµÄ·½·¨getInputStream()ºÍgetOutputStream() ......
java¹¤³§Ä£Ê½µÄѧϰ£¬³õÆÚµÄʱºòÔÚÍøÉϲéÁ˺ܶàÀý×Ó£¬×Ô¼ºÊ¼ÖÕÖ»Äܹ¹½¨¼òµ¥¹¤³§£¬ºóÀ´ÖÕÓÚÕÒµ½ÁËÏÂÃæÕâ·ÝÎĵµ²Å¶Ô¹¤³§Ä£Ê½ÓÐÁËÒ»¸öÈ«ÃæµÄÀí½â£¬²¢ÇÒΪ´ËÎĵµµÄ³éÏ󹤳§ÌṩÁËʵÀý£º
JAVA¹¤³§Ä£Ê½
¿´ÁËÕâô¶à¹ØÓÚ¹¤³§Ä£Ê½µÄ½²½â£¬»¹ÊǾõµÃÕâƪÎÄÕ½²µÄºÃÀí½â£¬Ìù³öÀ´ºÍ´ó¼Ò·ÖÏí·ÖÏí¡£
Ò»¡¢Òý×Ó
  ......