TemporaryResources tmp = new TemporaryResources();
try {
TikaInputStream tis = TikaInputStream.get(input, tmp);
byte[] prefix = new byte[1024]; // enough for all known formats
int length = tis.peek(prefix);
MediaType type = detectArchiveFormat(prefix, length);
if (PackageParser.isZipArchive(type)
&& TikaInputStream.isTikaInputStream(input)) {
return detectZipFormat(tis);