Java Properties to String propertiesToString(Properties p)

Here you can find the source of propertiesToString(Properties p)

Description

properties To String

License

LGPL

Declaration

public static String propertiesToString(Properties p) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.ByteArrayOutputStream;

import java.io.PrintStream;

import java.util.Properties;

public class Main {
    public static String propertiesToString(Properties p) {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        PrintStream out = new PrintStream(outStream);
        for (Object key : p.keySet()) {
            out.println(key + "=" + p.getProperty(key.toString()));
        }// ww w . j av a 2 s.co m
        out.close();
        return new String(outStream.toByteArray());
    }
}

Related

  1. propertiesToString(final Properties p)
  2. propertiesToString(final Properties properties)
  3. propertiesToString(Properties properties)
  4. propertiesToString(Properties properties)
  5. propertiesToString(Properties props)
  6. propertiesToString(Properties props, String comment)