Skip to content
Tagged articles

BufferedInputStream

2 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
Programmer DD
Programmer DD
Nov 9, 2020 · Backend Development

How to Speed Up Java File Compression: From 30 Seconds to 1 Second with NIO

This article walks through a real‑world Java file‑compression task, shows why a naïve implementation takes 30 seconds for a 20 MB batch, and demonstrates five progressive optimizations—BufferedInputStream, NIO Channel, memory‑mapped files, Pipe, and code snippets—that cut the time down to about one second while explaining the underlying I/O mechanisms.

BufferedInputStreamJavaMemoryMappedFile
0 likes · 12 min read
How to Speed Up Java File Compression: From 30 Seconds to 1 Second with NIO