Java ObjectOutputStream Write saveParameters()

Here you can find the source of saveParameters()

Description

save Parameters

License

Apache License

Declaration

public static void saveParameters() 

Method Source Code

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

import java.io.FileOutputStream;
import java.io.IOException;

import java.io.ObjectOutputStream;

import java.util.HashMap;

public class Main {
    private final static String FILENAME_PARAMETERS = "parameters.pfe";
    private static HashMap<String, Object> paramsMap;

    public static void saveParameters() {
        try {// w w w.j  a  v  a  2 s  .  c  o  m
            FileOutputStream fos = new FileOutputStream(FILENAME_PARAMETERS);
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(paramsMap);
            oos.close();
            fos.close();
            System.out.printf("Serialized HashMap data is saved in parameters.pfe");
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
}

Related

  1. saveObjectToFile(File file, Object object)
  2. saveObjectToFile(File thatFile, Object... thisObject)
  3. saveObjectToFile(final Object object, final String fileName)
  4. saveObjectToFile(Object obj, String fileName)
  5. saveObjectToPath(T objectToSave, String pathToSaveTo)
  6. saveResultToStream(ObjectOutputStream oos, Object result)
  7. saveResultToStream(ObjectOutputStream oos, Object result)
  8. saveSerializableObject(Object obj, String path)
  9. saveSerialized(Serializable obj, File file)