code: public static void storeProperties(Map pProperties, OutputStream pOutput, String pHeader) throws IOException {
      // Create new properties
      Properties props = new Properties();
  
      // Copy all elements from the pProperties (shallow)
      Iterator iterator = pProperties.entrySet().iterator();
  
      while (iterator.hasNext()) {
        Map.Entry entry = (Map.Entry) iterator.next();
  
        props.setProperty((String) entry.getKey(), StringUtil.valueOf(entry.getValue()));
      }
  
      // Store normal properties
      props.store(pOutput, pHeader);
    }
docs: Utility method that stores the property list in normal properties
  format. This method writes the list of Properties (key and element
  pairs) in the given {@code Properties}
  table to the output stream in a format suitable for loading into a
  Properties table using the load method. The stream is written using the
  ISO 8859-1 character encoding.
  
  @param pProperties the Properties table to store
  @param pOutput the output stream to write to.
  @param pHeader a description of the property list.
  
  @exception IOException if writing this property list to the specified
  output stream throws an IOException.
  
  @see java.util.Properties#store(OutputStream,String)