Java org.apache.poi.poifs.filesystem FileMagic fields, constructors, methods, implement or subclass

Example usage for Java org.apache.poi.poifs.filesystem FileMagic fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.poi.poifs.filesystem FileMagic.

The text is from its open source code.

Field

FileMagicOLE2
OLE2 / BIFF8+ stream used for Office 97 and higher documents
FileMagicOOXML
OOXML / ZIP stream

Method

InputStreamprepareToCheckMagic(InputStream stream)
Checks if an InputStream can be reset (i.e.
FileMagicvalueOf(byte[] magic)
FileMagicvalueOf(final File inp)
Get the file magic of the supplied File

Even if this method returns FileMagic#UNKNOWN it could potentially mean, that the ZIP stream has leading junk bytes

FileMagicvalueOf(InputStream inp)
Get the file magic of the supplied InputStream (which MUST support mark and reset).

If unsure if your InputStream does support mark / reset, use #prepareToCheckMagic(InputStream) to wrap it and make sure to always use that, and not the original!

Even if this method returns FileMagic#UNKNOWN it could potentially mean, that the ZIP stream has leading junk bytes