How to unpickle a file in Java?
问题 I have a 'pickle' format datafile that was created by a Python process (actually, the MCDungeon cache file). I want to read this from a Java program. To do this, I have used this code: public HashMap<String, Object> getDataFileStream(String filename) { HashMap<String, Object> data = new HashMap<String, Object>(); File f = new File(filename); InputStream fs = null; try { fs = new FileInputStream(f); } catch (FileNotFoundException e) { Log.warning("Pickle file '"+filename+"' not found!");