亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basicfileio.java

?? 文件輸入輸出操作的
?? JAVA
字號:
package java.lancs;/** * simple methods for file input/output (Java 1.1) * @author Roger Garside * @version Last Rewritten: 16/Sept/97 */import java.io.* ;public class BasicFileIo                                   {    /**     * Constant - input file     */    public static final int INPUT = 1 ;                              /**     * Constant - output file     */    public static final int OUTPUT = 2 ;    private int fileType ;    private PrintWriter pout ;    private BufferedReader fin ;    /**     * Constructor for BasicFileIo.     * Initialises the filetype to "unknown".     */    public BasicFileIo()         {        fileType = 0 ;        } // end of constructor method    /**     * Constructor for BasicFileIo.     * @param t    The filetype - either INPUT or OUPUT     * @param name The filename as a string     * @throws IOException If there is a problem opening the file     */    public BasicFileIo(int t, String name) throws IOException        {        if (t == OUTPUT)            {            pout = new PrintWriter(new FileWriter(name)) ;            fileType = OUTPUT ;            }        else if (t == INPUT)            {            fin = new BufferedReader(new FileReader(name)) ;            fileType = INPUT ;            }        else	    {            System.exit(1) ;            }        } // end of constructor method    /**     * Open a file. Can be opened for reading or writing     * @param t    The filetype - either INPUT or OUPUT     * @param name The filename as a string     * @throws IOException If there is a problem opening the file     */    public void openFile(int t, String name) throws IOException        {        if (fileType != 0)            {            System.exit(1) ;            }        if (t == OUTPUT)            {            pout = new PrintWriter(new FileWriter(name)) ;            fileType = OUTPUT ;            }        else if (t == INPUT)            {            fin = new BufferedReader(new FileReader(name)) ;            fileType = INPUT ;            }        else            {            System.exit(1) ;            }        } // end of method openFile    /**     * Close the current file     */    public void closeFile() throws IOException        {        if (fileType == INPUT) 	    fin.close() ;        else if (fileType == OUTPUT)	    pout.close() ;        else            System.exit(1) ;        fileType = 0 ;        } // end of method close    public void print(boolean b)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(b) ;        } // end of method print    public void print(char c)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(c) ;        } // end of method print    public void print(double d)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(d) ;        } // end of method print    public void print(float f)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(f) ;        } // end of method print    public void print(int i)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(i) ;        } // end of method print    public void print(long l)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(l) ;        } // end of method print    public void print(String s)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.print(s) ;        } // end of method print    public void println(boolean b)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(b) ;        } // end of method println    public void println(char c)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(c) ;        } // end of method println    public void println(double d)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(d) ;        } // end of method println    public void println(float f)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(f) ;        } // end of method println    public void println(int i)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(i) ;        } // end of method println    public void println(long l)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(l) ;        } // end of method println    public void println(String s)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println(s) ;        } // end of method println    public void println()        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        pout.println() ;        } // end of method println    /**     * read the next line from the file as a String     * @return the line read from the file as a String     * @throws IOException if an error occurs while reading the file     */    public String readString() throws IOException        {        if (fileType != INPUT)            {            System.err.println("not open for reading") ;            System.exit(1) ;            }        return fin.readLine() ;        } // end of method readString    /**     * Read a character from the file, the first on the line     * @return the first character on the next line     * @throws IOException If an error occurs while reading the file     */    public char readCharacter() throws IOException        {        if (fileType != INPUT)            {            System.err.println("not open for reading") ;            System.exit(1) ;            }        String line = fin.readLine() ;        if (line.length() == 0)            return ' ' ;        else            return line.charAt(0) ;        } // end of method readCharacter       /**     * read the next line from the file as an integer     * @return the line read from the file as an integer     * @throws IOException If the value read is not a valid integer     */    public int readInteger() throws IOException        {        String line ;        if (fileType != INPUT)            {            System.err.println("not open for reading") ;            System.exit(1) ;            }        try {            line = fin.readLine() ;            int i = Integer.parseInt(line.trim()) ;            return i ;            }        catch (Exception e)            {            throw new IOException("invalid integer") ;            }        } // end of method readInteger    /**     * read a float value from the file     * @return the float value read from the file     * @throws IOException If value read is not a valid float value     */    public float readFloat() throws IOException        {        String line ;        if (fileType != INPUT)            {            System.err.println("not open for reading") ;            System.exit(1) ;            }        try {            line = fin.readLine() ;            float f = Float.valueOf(line.trim()).floatValue() ;            return f ;            }        catch (Exception e)            {            throw new IOException("invalid float") ;            }        } // end of method readFloat      /**     * read a double value from the file     * @return the double value read from the file     * @throws IOException If value read is not a valid double value     */    public double readDouble() throws IOException        {        String line ;        if (fileType != INPUT)            {            System.err.println("not open for reading") ;            System.exit(1) ;            }        try {            line = fin.readLine() ;            double d = Double.valueOf(line.trim()).doubleValue() ;            return d ;            }        catch (Exception e)            {            throw new IOException("invalid double") ;            }        } // end of method readDouble    /**     * Write an integer to the file     * @param n The integer to be written     * @param w The width of the field to write the integer in     */    public void writeInteger(int n, int w)        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing") ;            System.exit(1) ;            }        Integer n1 = new Integer(n) ;        String t = n1.toString() ;        if (t.length() > w)            pout.print(t) ;        else            {            for (int i = 0 ; i < w - t.length() ; i++)                pout.print(' ') ;            pout.print(t) ;            }        } // end of method writeInteger    /**     * output a float to the file in a field of a specified width     * @param n the float to be output to the file     * @param w the width of the field     * @param d the number of decimal places     */    public void writeFloat(float n, int w, int d) throws IOException        {        if (fileType != OUTPUT)            {            System.err.println("not open for writing");            System.exit(1);            }              Float f1 = new Float(n);        String t = f1.toString();      	if (t.indexOf('e') != -1)	    throw new IOException("out of range") ;        if (d < 1)	    throw new IOException("invalid 3rd argument") ;	boolean negative = false ;	if (t.charAt(0) == '-')	    {	    negative = true ;	    t = t.substring(1) ;	    }	int index = t.indexOf('.') ;	int decimals ;	if (index == -1)	    decimals = 0 ;	else	    {	    decimals = t.length() - index - 1 ;            if (decimals <= 0)		throw new IOException("funny format") ;	    }	if (decimals < d)	    {	    if (decimals == 0)		t += '.' ;	    for (int i = 0 ; i < d - decimals ; i++)		t += '0' ;	    }	else if (decimals > d)	    {	    int offset = t.length() - decimals + d ;	    if (t.charAt(offset) < '5')		t = t.substring(0, t.length() - decimals + d) ;	    else		{		StringBuffer sb = new StringBuffer(t) ;		offset-- ;		while ((offset >= 0) &&		       ((sb.charAt(offset) == '9') ||		        (sb.charAt(offset) == '.')))		    {		    if (sb.charAt(offset) == '9')		        sb.setCharAt(offset, '0') ;		    offset-- ;		    }		if (offset >= 0)		    {		    sb.setCharAt(offset,	Character.forDigit(Character.digit(sb.charAt(offset), 10) + 1, 10)) ;	t = sb.toString().substring(0, t.length() - decimals + d) ;		    }		else	t = '1' + sb.toString().substring(0, t.length() - decimals + d) ;		}	    }	if (negative)	    t = '-' + t ;	if (t.length() > w)	    pout.print(t) ;	else	    {	    for (int i = 0 ; i < w - t.length() ; i++)		pout.print(' ') ;	    pout.print(t) ;	    }        } // end of method writeFloat    /**     * output a double to the file in a field of a specified width     * @param n the double to be output to the file     * @param w the width of the field     * @param d the number of decimal places     */    public void writeDouble(double n, int w, int d) throws IOException	{        if (fileType != OUTPUT)            {            System.err.println("not open for writing");            System.exit(1);            }      	Double n1 = new Double(n) ;	String t = n1.toString() ;	//System.err.println("string is **" + t + "**") ;	if (t.indexOf('e') != -1)	    throw new IOException("out of range") ;        if (d < 1)	    throw new IOException("invalid 3rd argument") ;	boolean negative = false ;	if (t.charAt(0) == '-')	    {	    negative = true ;	    t = t.substring(1) ;	    }	int index = t.indexOf('.') ;	int decimals ;	if (index == -1)	    decimals = 0 ;	else	    {	    decimals = t.length() - index - 1 ;            if (decimals <= 0)		throw new IOException("funny format") ;	    }	if (decimals < d)	    {	    if (decimals == 0)		t += '.' ;	    for (int i = 0 ; i < d - decimals ; i++)		t += '0' ;	    }	else if (decimals > d)	    {	    int offset = t.length() - decimals + d ;	    if (t.charAt(offset) < '5')		t = t.substring(0, t.length() - decimals + d) ;	    else		{		StringBuffer sb = new StringBuffer(t) ;		offset-- ;		while ((offset >= 0) &&		       ((sb.charAt(offset) == '9') ||		        (sb.charAt(offset) == '.')))		    {		    if (sb.charAt(offset) == '9')		        sb.setCharAt(offset, '0') ;		    offset-- ;		    }		if (offset >= 0)		    {		    sb.setCharAt(offset,	Character.forDigit(Character.digit(sb.charAt(offset), 10) + 1, 10)) ;	t = sb.toString().substring(0, t.length() - decimals + d) ;		    }		else	t = '1' + sb.toString().substring(0, t.length() - decimals + d) ;		}	    }	if (negative)	    t = '-' + t ;	if (t.length() > w)	    pout.print(t) ;	else	    {	    for (int i = 0 ; i < w - t.length() ; i++)		pout.print(' ') ;	    pout.print(t) ;	    }	} // end of method writeDouble} // end of class BasicFileIo

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产欧美另类丝袜| 久久国产尿小便嘘嘘| 日本午夜精品一区二区三区电影| 美女视频免费一区| 91麻豆国产自产在线观看| 欧美一区二区三区在线观看视频| 欧美激情一二三区| 亚洲成人动漫在线免费观看| 成人自拍视频在线观看| 欧美一区二区黄| 亚洲一区二区三区四区在线| 国产成人精品免费| 91精品国产综合久久久久久久| 中文字幕精品三区| 国内精品国产成人| 制服丝袜中文字幕一区| 亚洲女子a中天字幕| 成人自拍视频在线观看| 精品国产区一区| 日韩国产精品久久| 欧美三级电影一区| 亚洲女与黑人做爰| 91蜜桃网址入口| 国产精品三级av| 国产寡妇亲子伦一区二区| 日韩亚洲欧美成人一区| 日韩avvvv在线播放| 欧美日韩一区二区三区在线看| 国产精品久线观看视频| 成人小视频在线| 一级做a爱片久久| 高清beeg欧美| 国产精品视频观看| 国产成人日日夜夜| 国产女同性恋一区二区| 国产精品亚洲一区二区三区在线 | 色94色欧美sute亚洲13| 亚洲欧洲另类国产综合| jvid福利写真一区二区三区| 国产亚洲精品超碰| 成人性生交大合| 国产精品丝袜91| 91猫先生在线| 亚洲综合一二区| 欧美美女黄视频| 日本中文字幕不卡| 日韩精品中文字幕一区| 国产在线一区观看| 欧美国产日韩亚洲一区| 99久久免费精品| 亚洲精品久久嫩草网站秘色| 欧美午夜影院一区| 奇米影视一区二区三区小说| 久久这里都是精品| 成人美女视频在线看| 亚洲免费高清视频在线| 欧美老肥妇做.爰bbww| 蜜臀91精品一区二区三区| 欧美精品一区二区三区一线天视频| 久久国产精品无码网站| 亚洲国产精品精华液2区45| 99久久99久久精品免费看蜜桃| 一区二区三区蜜桃| 日韩一本二本av| 成人av先锋影音| 亚洲一区二区三区在线播放| 精品日韩av一区二区| 波多野结衣一区二区三区 | 欧美亚洲图片小说| 青青草97国产精品免费观看 | 蜜臀a∨国产成人精品| 国产欧美日韩不卡免费| 欧美综合一区二区| 国产一区中文字幕| 亚洲综合免费观看高清完整版| 欧美一区二区在线不卡| 国产成人av一区二区| 亚洲成人在线网站| 中文字幕不卡在线播放| 欧美日韩国产不卡| 99久久免费精品高清特色大片| 日韩福利电影在线| 亚洲激情图片小说视频| 精品欧美黑人一区二区三区| 欧洲色大大久久| 国产成人在线观看免费网站| 香蕉影视欧美成人| 亚洲欧洲一区二区三区| 精品国产免费视频| 欧美日韩不卡一区| 91理论电影在线观看| 国产美女主播视频一区| 日韩—二三区免费观看av| 亚洲精品国产无天堂网2021| 久久久久久亚洲综合影院红桃| 欧美另类videos死尸| 91一区二区三区在线观看| 国内成人免费视频| 久久精品国产精品青草| 亚洲成人综合网站| 亚洲乱码国产乱码精品精的特点| 久久日一线二线三线suv| 69av一区二区三区| 欧美日韩一区成人| 91福利国产成人精品照片| 国产999精品久久久久久绿帽| 麻豆国产欧美日韩综合精品二区| 亚洲一区在线观看免费| 亚洲精品乱码久久久久| 亚洲欧美一区二区视频| 国产精品美女久久久久久久| 欧美videos中文字幕| 日韩欧美在线不卡| 日韩欧美国产小视频| 欧美三区在线观看| 欧美探花视频资源| 欧美日韩在线播放一区| 色综合久久九月婷婷色综合| 91污在线观看| 91久久久免费一区二区| 欧美亚洲免费在线一区| 欧美性色欧美a在线播放| 欧美三级中文字幕| 欧美日韩国产精品成人| 欧美精品xxxxbbbb| 日韩欧美卡一卡二| 精品国产伦一区二区三区观看方式 | 欧美一卡在线观看| 欧美变态tickling挠脚心| 久久亚洲春色中文字幕久久久| 久久久综合视频| 国产精品久久久久久亚洲毛片 | 91精品中文字幕一区二区三区| 6080日韩午夜伦伦午夜伦| 宅男在线国产精品| 久久久噜噜噜久久中文字幕色伊伊| 久久综合五月天婷婷伊人| 国产精品毛片久久久久久久| 亚洲人成人一区二区在线观看 | 日本一二三不卡| 亚洲黄色在线视频| 亚洲高清免费视频| 国内精品国产成人国产三级粉色| 粉嫩一区二区三区性色av| 91麻豆产精品久久久久久| 欧美日韩高清不卡| 久久久久久99久久久精品网站| 国产嫩草影院久久久久| 一区二区三区欧美久久| 日本美女视频一区二区| 国产精品一品视频| 欧美午夜不卡在线观看免费| 欧美一区二区成人| 综合久久久久久| 秋霞电影一区二区| av中文字幕一区| 欧美一区二区三区视频在线观看| 国产日产精品1区| 性做久久久久久久免费看| 国产在线精品免费| 欧美日韩在线播| 国产精品天干天干在观线| 天天亚洲美女在线视频| 国产成人精品午夜视频免费| 51精品视频一区二区三区| 国产精品毛片久久久久久久| 免费成人美女在线观看.| 99久久精品免费精品国产| 精品久久一区二区| 亚洲第一搞黄网站| 99久久久无码国产精品| 精品国产乱码久久久久久影片| 一个色妞综合视频在线观看| 东方aⅴ免费观看久久av| 日韩一区二区不卡| 亚洲综合在线视频| 成人伦理片在线| www国产精品av| 蜜臀久久99精品久久久久久9| 91传媒视频在线播放| 中文字幕在线视频一区| 国产在线精品视频| 精品国产乱码久久久久久夜甘婷婷| 精品一区二区三区日韩| 欧美日韩日日摸| 亚洲综合色视频| 91国产福利在线| 亚洲欧洲综合另类| 成人福利视频在线| 亚洲国产精品成人综合色在线婷婷 | 91黄色激情网站| 中文字幕亚洲综合久久菠萝蜜| 国产成人精品一区二| 久久先锋影音av| 黄色日韩三级电影| 欧美va亚洲va香蕉在线| 久久福利资源站| 精品美女被调教视频大全网站| 久久精品999| 精品理论电影在线观看|