Serialization error occures when write a workbook that contains multibyte string style record. Exception in thread "main" java.lang.IllegalStateException: Incorrect number of bytes written - expected 35 but got 22 at org.apache.poi.hssf.record.StandardRecord.serialize(StandardRecord.java:39) at org.apache.poi.hssf.model.Workbook.serialize(Workbook.java:953) at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:1287) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1191) at Test.main(Test.java:22) Maybe, it is cause of StyleRecord doesn't care about uncompressed unicode or compressed unicode by hasMultibyte. I have attached a patch. Please check it.
Created attachment 23000 [details] patch
Applied in svn 726969 Thanks for the patch, Matsuyama. JUnit updated too.
*** Bug 46385 has been marked as a duplicate of this bug. ***
(svn r726969)