Index: tika-parsers/src/main/java/org/apache/tika/detect/ZipContainerDetector.java
===================================================================
--- tika-parsers/src/main/java/org/apache/tika/detect/ZipContainerDetector.java	(revision 981461)
+++ tika-parsers/src/main/java/org/apache/tika/detect/ZipContainerDetector.java	(working copy)
@@ -18,8 +18,9 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Collections;
 import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
+import java.util.zip.ZipFile;
 
 import org.apache.poi.extractor.ExtractorFactory;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -37,29 +38,32 @@
  *  to figure out exactly what the file is
  */
 public class ZipContainerDetector implements Detector {
+
     public MediaType detect(InputStream input, Metadata metadata)
              throws IOException {
-	if(input instanceof TikaInputStream) {
-	    return detect((TikaInputStream)input, metadata);
-	}
-	return detect( TikaInputStream.get(input), metadata );
+        if (TikaInputStream.isTikaInputStream(input)) {
+            return detect(TikaInputStream.get(input));
+        } else {
+            return MediaType.APPLICATION_ZIP;
+        }
     }
-    public MediaType detect(TikaInputStream input, Metadata metadata)
-             throws IOException {
-        ZipInputStream zip = new ZipInputStream(input);
-        ZipEntry entry = zip.getNextEntry();
-        while (entry != null) {
+
+    private MediaType detect(TikaInputStream input) throws IOException {
+        ZipFile zip = new ZipFile(input.getFile());
+        for (ZipEntry entry : Collections.list(zip.entries())) {
             // Is it an Open Document file?
             if (entry.getName().equals("mimetype")) {
-                String type = IOUtils.toString(zip, "UTF-8");
-                return fromString(type);
+                InputStream stream = zip.getInputStream(entry);
+                try {
+                    return fromString(IOUtils.toString(stream, "UTF-8"));
+                } finally {
+                    stream.close();
+                }
             } else if (entry.getName().equals("_rels/.rels") || 
         	    entry.getName().equals("[Content_Types].xml")) {
                 // Office Open XML File
         	// As POI to open and investigate it for us
         	try {
-        	    input.reset();
-        	    
         	    OPCPackage pkg = OPCPackage.open(input);
         	    input.setOpenContainer(pkg);
         	    
@@ -85,8 +89,6 @@
         	// Java Jar
         	return MediaType.application("java-archive");
             }
-            
-            entry = zip.getNextEntry();
         }
         
         return MediaType.APPLICATION_ZIP;
Index: tika-parsers/src/main/java/org/apache/tika/detect/POIFSContainerDetector.java
===================================================================
--- tika-parsers/src/main/java/org/apache/tika/detect/POIFSContainerDetector.java	(revision 981461)
+++ tika-parsers/src/main/java/org/apache/tika/detect/POIFSContainerDetector.java	(working copy)
@@ -16,6 +16,7 @@
  */
 package org.apache.tika.detect;
 
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -23,7 +24,6 @@
 import org.apache.tika.io.TikaInputStream;
 import org.apache.tika.metadata.Metadata;
 import org.apache.tika.mime.MediaType;
-import org.apache.tika.parser.microsoft.OfficeParser;
 import org.apache.tika.parser.microsoft.OfficeParser.POIFSDocumentType;
 
 
@@ -32,20 +32,21 @@
  *  to figure out exactly what the file is
  */
 public class POIFSContainerDetector implements Detector {
+
     public MediaType detect(InputStream input, Metadata metadata)
              throws IOException {
-        POIFSFileSystem fs = new POIFSFileSystem(input);
+        if (TikaInputStream.isTikaInputStream(input)) {
+            TikaInputStream stream = TikaInputStream.get(input);
 
-        POIFSDocumentType type =
-            OfficeParser.POIFSDocumentType.detectType(fs);
-        
-        if(input instanceof TikaInputStream) {
-            ((TikaInputStream)input).setOpenContainer(fs);
+            // NOTE: POIFSFileSystem will close the FileInputStream
+            POIFSFileSystem fs =
+                new POIFSFileSystem(new FileInputStream(stream.getFile()));
+            stream.setOpenContainer(fs);
+
+            return POIFSDocumentType.detectType(fs).getType();
         } else {
-            fs = null;
+            return MediaType.application("x-tika-msoffice");
         }
-        
-        return type.getType();
     }
+
 }
-
Index: tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java
===================================================================
--- tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java	(revision 981461)
+++ tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java	(working copy)
@@ -38,6 +38,19 @@
 public class TikaInputStream extends ProxyInputStream {
 
     /**
+     * Checks whether the given stream is a TikaInputStream instance.
+     * The given stream can be <code>null</code>, in which case the return
+     * value is <code>false</code>.
+     * 
+     * @param stream input stream, possibly <code>null</code>
+     * @return <code>true</code> if the stream is a TikaInputStream instance,
+     *         <code>false</code> otherwise
+     */
+    public static boolean isTikaInputStream(InputStream stream) {
+        return stream instanceof TikaInputStream;
+    }
+
+    /**
      * Casts or wraps the given stream to a TikaInputStream instance.
      * This method can be used to access the functionality of this class
      * even when given just a normal input stream instance.
