My code like below.
Map<String, String> aMap = new HashMap();
aMap.put("A", "a");
FileOutputStream fos = new FileOutputStream(new File("some.txt"));
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.write(aMap);
oos.flush();
oos.close();
I thought I need to close fos, but other says its fine. Is it really fine to not close FileOutputStream, because I already closed inner OutputStream?