java IO
Rubicon
input stream Out stream
DataInputStream DataIOutStream
BufferedInputStream BufferedOutStream
LineNumberInputStream PrintStream
PushbackInputStream
ÒÔ×Ö½ÚΪµ¼
ÏòµÄ stream
----------(ÎÞ¶ÔÓ¦µÄ)
BufferedReader BufferedWrite
LineNumberReader PrintWrite
ÒÔUnicode×Ö
·ûΪµ¼ÏòµÄ
stream
PushBackReader
Table 3.0
3.1 ÒÔ×Ö½ÚΪµ¼ÏòµÄstream£º
3.1.1 Input Stream
1) DataInputStream£º´ÓstreamÖжÁÈ¡»ù±¾ÀàÐÍ£¨int¡¢charµÈ£©Êý¾Ý¡£
2) BufferedInputStream£ºÊ¹Óûº³åÇø
3) LineNumberInputStream£º»á¼Ç¼input streamÄÚµÄÐÐÊý£¬È»ºó¿ÉÒÔµ÷ÓÃgetLineNumber()ºÍsetLineNumber(int)
4) PushbackInputStream£ººÜÉÙÓõ½£¬Ò»°ãÓÃÓÚ±àÒëÆ÷¿ª·¢
3.1.2 . Output Stream
1) DataIOutStream£ºÍùstreamÖÐÊä³ö»ù±¾ÀàÐÍ£¨int¡¢charµÈ£©Êý¾Ý¡£
2) BufferedOutStream£ºÊ¹Óûº³åÇø
3) PrintStream£º²úÉú¸ñʽ»¯Êä³ö
3.2 ÒÔ×Ö·ûΪµ¼ÏòµÄStream
3.2.1 Input Stream
1) ûÓÐÓëDataInputStream¶ÔÓ¦µÄÀà¡£³ý·ÇÔÚҪʹÓÃreadLine()ʱ¸ÄÓÃBufferedReader£¬·ñÔòʹÓÃ
DataInputStream
2) BufferedReader£ºÓëBufferedInputStream¶ÔÓ¦
3) LineNumberReader£ºÓëLineNumberInputStream¶ÔÓ¦
4) PushBackReader£ºÓëPushbackInputStream¶ÔÓ¦
3.2.2 Output Stream
1) BufferedWrite£ºÓë¶ÔÓ¦
2) PrintWrite£ºÓë¶ÔÓ¦
3. 3 RandomAccessFile
1) ¿Éͨ¹ýRandomAccessFile¶ÔÏóÍê³É¶ÔÎļþµÄ¶Áд²Ù×÷
2) ÔÚ²úÉúÒ»¸ö¶ÔÏóʱ£¬¿ÉÖ¸Ã÷Òª´ò¿ªµÄÎļþµÄÐÔÖÊ£ºr£¬Ö»¶Á£»w£¬Ö»Ð´£»rw¿É¶Áд
3) ¿ÉÒÔÖ±½ÓÌøµ½ÎļþÖÐÖ¸¶¨µÄλÖà Java I/O
ÊäÈë/Êä³ö·ºÖ¸¶Ôij¸öÉ豸»ò»·¾³½øÐÐÊý¾ÝµÄÊäÈë»òÊä³ö¡£ÀýÈç¶ÔÓ²Å̽øÐÐÊäÈë/Êä³ö¡¢¶ÔÊÓƵ½øÐÐÊäÈë
/Êä³ö¡¢¶ÔÍøÂçÉÏÖ÷»ú½øÐÐÊäÈë/Êä³öµÈ£¬¿ÉÒÔÏëÏó£¬ÒòÉ豸»ò»·¾³µÄ²»Í¬£¬»áÓи÷ʽ¸÷ÑùµÄÊäÈë/Êä³öÎÊÌâ
Óë½â¾ö·½°¸¡£ÊäÈë/Êä³öÎÊÌâÔÚ³ÌÐòÉè¼ÆÖÐʵ¼ÊÉÏÊÇÒ»¸öºÜ¸´ÔÓµÄÎÊÌâ¡£
¶ÔÓÚÊäÈë/Êä³öÎÊÌ⣬Java½«Ö®³éÏó»¯ÎªÁ÷£¨Stream£©¶ÔÏóÀ´½â¾ö¡£¶Ô²»Í¬µÄÊäÈë/Êä³öÎÊÌ⣬»áÓÐÏàÓ¦
µÄÁ÷¶ÔÏóÌṩ½â¾ö·½°¸¡£±¾ÎÄÕ¾ÍÊÇҪѧϰJavaÖи÷ʽ¸÷Ñù½â¾öÊäÈë/Êä³öÎ
Ïà¹ØÎĵµ£º
°ÑÒÔÇ°×ö¹ýµÄÏîÄ¿×ܽáһϣ¡²Î¼Ó¹¤×÷ÒÔÀ´Ò»¹²ÓÃÈýÖÖ²»Í¬ÓïÑÔʵÏÖÁË»ñµÃÎļþ¼Ð¼°Æä×ÓÎļþÐÅÏ¢¡£ÎªÁË·½±ãÒÔºóʹÓÃ×ܽáÒ»ÏÂ
airʵÏÖ£º
private function getfile(filelist:File):Array{
var list:Array = filelist.getDirectoryListing();
var count:uint=list.length;
......
×î½ü³õ²½½Ó´¥ÁËÏÂJava¼ÓÃܺÍÊý×ÖÇ©ÃûµÄÏà¹ØÄÚÈÝ£¬ÎÒѧϰµÄ¹ý³Ì´ó¸Å·ÖÎå²½£º
1£©ÏûÏ¢ÕªÒª
2£©Ë½Ô¿¼ÓÃÜ
3£©¹«Ô¿¼ÓÃÜ
4£©Êý×ÖÇ©Ãû
5£©Êý×ÖÖ¤Êé
ÏÂÃæµÄ´úÂëÊǵÚÈý²¿·Ö£º¹«Ô¿¼ÓÃÜ
Ï£ÍûÄÜΪ¸Õ¸Õ½Ó´¥Õâ¸öµÄÅóÓÑÃÇÊ¡µãÊÂ
package security;
import java.security.KeyPair;
import java.security.KeyPairGenerator ......
import java.util.concurrent.Semaphore;
/**
* ³éÏóÈÎÎñ£¬¾ßÌåµÄÖ´ÐÐÈÎÎñ£¬¹éʵÏÖÀฺÔð
*
* @author Administrator
*
*/
public abstract class Task {
public abstract void run();
private Semaphore s;
private boolean hasExisted = false;
public void P(final Semaphore s) throws Interrupt ......
import java.util.Date;
import java.text.SimpleDateFormat; //ΪÁËÏÔʾʱ¼ä¶ø¼Ó
Date date = new Date(); //»ñµÃϵͳʱ¼ä.
String nowTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
//½«Ê±¼ä¸ñʽת»»³É·ûºÏTimestampÒªÇóµÄ¸ ......
ÈçºÎÔÚDosϱàÒëºÍÔËÐÐJava³ÌÐò£¿
2009-03-27 01:37
½ñÌìÕýʽµÄ½Ó´¥µ½Java³ÌÐò£¬Ñ§»áÁËÈçºÎÔÚDosϱàÒëºÍÔËÐÐJava³ÌÐò£¬ºÜÊÇÐÀµ«ÔÚѧϰ¹ý³ÌÖÐÓöµ½ÁËһЩÎÊÌ⣬¾¹ýºÍÍŶӳÉÔ±µÄ¹²Í¬Å¬Á¦ÖÕÓÚ½â¾öÁËÎÊÌ⣬ÔÚÕâÀïÎÒ̸̸½ñÌìѧϰµÄ¹ý³Ì£º
µÚÒ»£ºÊ×ÏÈ°²×°JDK¡£
&nbs ......