Thursday 22 December 2011

Save hash table to string

Save hash table to string
This task use java to save hash table to string.
Save hash table to string using ByteArrayOutputStream
public String writeHash(Properties properties) {
    String tag = "";
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        properties.store(baos, "");
        tag = baos.toString();
        baos.close();
    } catch (Exception e) {
        logger.error("", e);
    }
    return tag;
}
    

  Protected by Copyscape Online Copyright Protection

No comments:

Post a Comment