I'm trying to write the content of a list (object) to disk using ObjectOutputStream.
This is the relevant code:
//Input Filetype is .xlsx with an embedded File (also .xlsx), Output Filetype should be .xlsx (Type of embedded File)
//This code should save the embedded File to D:\\...
List<HSSFObjectData> extrList = new ArrayList<HSSFObjectData>();
HSSFWorkbook embeddedWorkbook = new HSSFWorkbook(pPart.getInputStream());
extrList = embeddedWorkbook.getAllEmbeddedObjects();
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("D:\\scan_temp\\emb.xlsx"));
oos.writeObject(extrList);
oos.flush();
oos.close();
This code creates a file called emb.xlsx, but the content is not what I expected. If I try to open using notepad, it's something like:
¬í sr java.util.ArrayListxÒ™Ça I sizexp w x
What am I doing wrong here? Thanks for any help.