On 2009-02-26, Christian Grobmeier <grobme...@gmail.com> wrote: > I recently figured out that a compress created zip file doesn't > necessary match the signature of > ZipArchiveInputStream.matches(...)
This is because the method is wrong - will be "fixed" in a few minutes, see below. The expected signature right now is "local file header marker" - four bytes "version needed to extract" - two bytes "general purpose flag" - two bytes you really only can rely on the LFH-signature since "version needed to extract" will be different for many archivers, as will be the general purpose bits. I'll reduce the sugnature check to the LFH. Note that the method (or better the input stream) is still broken in a more general sense since it will not detect self extracting ZIP files which do have a tiny native bootstrapper tacked to the front of the archive. The ZipFile class can read them, ZipArchiveInputStream can't. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org