You can develop your own class that extends the any reader class and then override the methods that you wnat to use.
But u will have to develop your own class.
public class Driver
{
public static void main(String[] arg) throws IOException
{
StringBuffer data = new StringBuffer();
BufferedReader reader = new BufferedReader(new FileReader(new File("data.txt"));
String tmp = reader.readLine();
while(tmp != null)
{
StringTokenizer strTok = new StringTokenizer(tmp,"|"
//Saving the data into the StringBuffer
//You don't have to do this, it dependes
//on what you want to to with your data
while(strTok.hasMoreTokens())
{
data.append(strTok.nextToken());
}
data.append("\n"
tmp = reader.readLine();
}
BufferedReader reader = new BufferedReader(new FileReader(new File("DBFile.dat"));
String tmp = reader.readLine();
while(tmp != null)
{
lblMessage.setText("1St While"
StringTokenizer strTok = new StringTokenizer(tmp,"|"
//Saving the data into the StringBuffer
//You don't have to do this, it dependes
//on what you want to to with your data
while(strTok.hasMoreTokens())
{
lblMessage.setText("2nd While"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.