How to get back Hashtable from .txt file use Properties ?
Posted
by tiendv
on Stack Overflow
See other posts from Stack Overflow
or by tiendv
Published on 2010-05-12T19:34:24Z
Indexed on
2010/05/12
19:54 UTC
Read the original article
Hit count: 190
This is code to write hastable to .txt file !
public static void save(String filename, Map<String, String> hashtable) throws IOException {
Properties prop = new Properties();
prop.putAll(hashtable);
FileOutputStream fos = new FileOutputStream(filename);
try {
prop.store(fos, prop);
} finally {
fos.close();
}
}
How we getback the hashtable from that file ? Thanks
© Stack Overflow or respective owner