BufferedReader ?
in
Programming Questions
•
1 year ago
Okay! New to Processing and I'm just trying to read data from a file but I'm finding it almost impossible. Not new to Java and image processing but this one stumps me. I used the standard example but continue to get the error : "cannot convert from BufferedReader to BufferedReader". Java is installed okay but not sure if Processing uses the Java JDK.
BufferedReader reader;
String line;
void setup() {
// Open the file from the createWriter() example
reader = createReader("positions.txt");
}
void draw() {
try {
line = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
line = null;
}
if (line == null) {
// Stop reading because of an error or file is empty
noLoop();
} else {
String[] pieces = split(line, TAB);
int x = int(pieces[0]);
int y = int(pieces[1]);
point(x, y);
}
}
1