https://bz.apache.org/bugzilla/show_bug.cgi?id=60741
Bug ID: 60741 Summary: NPOIFS move from read-only flag to 3-state enum Product: POI Version: 3.16-dev Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P2 Component: POIFS Assignee: dev@poi.apache.org Reporter: apa...@gagravarr.org Target Milestone: --- Currently, in NPOIFS (NPOIFSFileSystem + POIFSFileSystem, but not OPOIFSFileSystem), you can either load from a File or from a Stream. With a Stream, everything gets buffered into memory When loading from a File, you can load read-write or read-only. In read-write mode, we use NIO to mmap the file so we can quickly + low memory read + write. The other case, File + read-only, isn't so ideal. We need to support both people doing true read-only cases, eg reading or text extraction, plus people doing read-template + write or read-change-save-as cases. To support that, we buffer into memory. Instead, if we changed the read-write state to an enum with 3 states, we could have: * Read/Write - unchanged * Read Only - mmap in read-only mode, text extraction etc only * Read as Template - mmap in private mode, changes buffered in memory, able to write out to a new file That'd mean lower memory use, and more consistent code. Naming TBC -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org