Java   View all facts   Glossary   Help
action > reading from a file
Next actionwriting to a file    Upaction

reading from a file comparison table
Subject have syntax is a kind of is a subtopic of
action kbTop 
reading from a file
//Instantiate a stream, reader and tokenizer
FileInputStream streamVariableName = new FileInputStream(fileNameOrPath);
InputStreamReader readerVariableName = new InputStreamReader(streamVariableName);
StreamTokenizer tokenVariableName = new StreamTokenizer(readerVariableName);
//Read from the tokenizer until it is empty
while(tokenVariableName.nextToken() != tokenVariableName.TT_EOF) {
...
}
//Close the file
streamVariableName.close();
actionInput and Output

Next actionwriting to a file    Upaction