本文整理汇总了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;
}
示例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();
}
示例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();
}
}