|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The ILineReader interface defines the API for line-oriented
reading of an InputStream. An instance of
ILineReader can be created using the FactoryUtility
singleton.
InputStream stream = ...
FactoryUtility utility = FactoryUtility.getInstance();
try {
ILineReader reader = null;
try {
reader = utility.createLineReader(stream);
...
} finally {
if (reader != null) {
reader.close();
}
}
} catch (IOException exception) {
...
}
While a single line may be read using the readLine() method,
reading multiple lines is typically done by calling the lines()
method that returns an Enumeration.
Enumeration lines = reader.lines();
while (lines.hasMoreElements() == true) {
String line = (String) lines.nextElement();
...
}
The nested IAdvisor interface defines the advice that can be
given an ILineReader as each line is read.
ILineReader.IAdvisor,
FactoryUtility| Nested Class Summary | |
static interface |
ILineReader.IAdvisor
The IAdvisor interface defines the advice that can be given
to an ILineReader as each line is read. |
| Method Summary | |
void |
close()
Close the receiver. |
Enumeration |
lines()
Answers an Enumeration for reading lines. |
String |
readLine()
Reads and answers a single line. |
| Method Detail |
public void close()
throws IOException
java.io.IOException
IOExceptionpublic Enumeration lines()
Enumeration for reading lines.
Enumeration used for reading the lines from the
InputStream.
public String readLine()
throws IOException
String containing single line from the source
InputStream.
java.io.IOException
IOException
|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.