diff --git a/src/testcases/org/apache/poi/hssf/data/42564.xls b/src/testcases/org/apache/poi/hssf/data/42564.xls new file mode 100644 index 0000000000..dff150e2dc Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/42564.xls differ diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 590ec4943c..616ec8b1f6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1010,6 +1010,26 @@ extends TestCase { assertTrue("No Exceptions while reading file", true); } + /** + * Bug 42564: Some files from Acess were giving a RecordFormatException + * when reading the BOFRecord + */ + public void test42564() throws Exception { + FileInputStream in = new FileInputStream(new File(cwd, "42564.xls")); + HSSFWorkbook wb = new HSSFWorkbook(in); + in.close(); + + assertTrue("No Exceptions while reading file", true); + + //serialize and read again + ByteArrayOutputStream out = new ByteArrayOutputStream(); + wb.write(out); + out.close(); + + wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray())); + assertTrue("No Exceptions while reading file", true); + } + /** * Bug 42618: RecordFormatException reading a file containing * =CHOOSE(2,A2,A3,A4)