Tagged articles

FileMagic

1 articles · Page 1 of 1
Tech Musings
Tech Musings
Sep 16, 2026 · Backend Development

FileMagic IOException on Excel Upload: The FileInputStream mark/reset Pitfall

FileMagic validation throws IOException on real Excel uploads because Tomcat's default FileInputStream lacks mark/reset support, unlike test ByteArrayInputStream; wrapping with BufferedInputStream fixes it, and regression tests must simulate real stream types to catch this.

Apache POIBufferedInputStreamEasyExcel
0 likes · 8 min read
FileMagic IOException on Excel Upload: The FileInputStream mark/reset Pitfall