当前位置: 首页>>代码示例>>Java>>正文


Java BufferedReader类代码示例

本文整理汇总了Java中com.sun.squawk.io.BufferedReader的典型用法代码示例。如果您正苦于以下问题:Java BufferedReader类的具体用法?Java BufferedReader怎么用?Java BufferedReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BufferedReader类属于com.sun.squawk.io包,在下文中一共展示了BufferedReader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readFile

import com.sun.squawk.io.BufferedReader; //导入依赖的package包/类
/**
 * Reads a file, returns a list of lines (strings) in the file.
 * Skips empty lines and lines starting with '#'.
 * 
 * @param loc URI of the file
 * @return Vector of strings, each string a line in the file
 * @throws IOException 
 */
private static Vector readFile(String loc) {
    Vector lines = new Vector();
    try {
        FileConnection fc = (FileConnection) Connector.open(loc);
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(fc.openInputStream()));

        String line;
        while ((line = reader.readLine()) != null) {
            if (!line.equals("") && !line.startsWith("#")) {
                lines.addElement(line);
            }
        }

        reader.close();
        fc.close();
    } catch (IOException e) {
        GRTLogger.logError("Constants file IO Error--probably nonexistent: "
                + e.getMessage());
    }

    return lines;
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:32,代码来源:GRTConstants.java

示例2: CSVInput

import com.sun.squawk.io.BufferedReader; //导入依赖的package包/类
public CSVInput(String path){
	
	try {
		FileConnection C = (FileConnection) Connector.open(path);
		reader = new BufferedReader(new InputStreamReader(C.openInputStream()));
	} catch (IOException e) {
		//Log.println(e.toString());
		//Log.println("failed to open CSV file " + path);
	}
	doubles = new Vector();
	ints = new Vector();
	strings = new Vector();
}
 
开发者ID:Team766,项目名称:Valkyrie,代码行数:14,代码来源:CSVInput.java

示例3: connect

import com.sun.squawk.io.BufferedReader; //导入依赖的package包/类
public void connect() {
	try {
		in = new BufferedReader(new InputStreamReader(connection
				.openInputStream()));
		out = new OutputStreamWriter(connection.openOutputStream());
		connected = true;
		notifyConnected();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:manitourobotics,项目名称:2013-robot,代码行数:12,代码来源:ClientSocket.java


注:本文中的com.sun.squawk.io.BufferedReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。