out =new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(pathToSave + ".ind")))); out.write(hashEncodeTable + "[#]"+someData);//Write out the specfied string to the file
as I have both Hashtable and some text in one file I have not used out.writeObject(hashEncodeTable) , and separated them with [#] .
Now I am reading the file and extracting the hashtable from the file in a string object using the following code .
indexOfKey = rawData.indexOf("[#]");
System.out.println("indexofkey ="+indexOfKey);
hashFromFile=rawData.substring(0,indexOfKey);
System.out.println("hashFromFile ="+hashFromFile);
The program is running fine . But now I need to convert the string object hashFromFile back to hashtable . In other words I need a way to save Hashtable along with some text in a text file , and then read the text file and separate the Hashtable and the text . I hope I have expressed my problem clearly . Please help .
This post has been edited by cybernaut09: 09 December 2008 - 03:23 PM

New Topic/Question
Reply




MultiQuote



|