Index: /trunk/src/VBox/Runtime/common/zip/tarcmd.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/zip/tarcmd.cpp	(revision 59825)
+++ /trunk/src/VBox/Runtime/common/zip/tarcmd.cpp	(revision 59826)
@@ -61,4 +61,5 @@
 #define RTZIPTARCMD_OPT_DIR_MODE_OR_MASK    1008
 #define RTZIPTARCMD_OPT_FORMAT              1009
+#define RTZIPTARCMD_OPT_READ_AHEAD          1010
 
 /** File format. */
@@ -104,4 +105,6 @@
      * traditional TAR format). */
     bool            fNoModTime;
+    /** Whether to add a read ahead thread. */
+    bool            fReadAhead;
     /** The compressor/decompressor method to employ (0, z or j). */
     char            chZipper;
@@ -494,7 +497,23 @@
     {
         /*
+         * Convert source to a stream and optionally add a read ahead stage.
+         */
+        RTVFSIOSTREAM hVfsIosSrc = RTVfsObjToIoStream(hVfsObj);
+        if (pOpts->fReadAhead)
+        {
+            RTVFSIOSTREAM hVfsReadAhead;
+            rc = RTVfsCreateReadAheadForIoStream(hVfsIosSrc, 0 /*fFlag*/, 16 /*cBuffers*/, _256K /*cbBuffer*/, &hVfsReadAhead);
+            if (RT_SUCCESS(rc))
+            {
+                RTVfsIoStrmRelease(hVfsIosSrc);
+                hVfsIosSrc = hVfsReadAhead;
+            }
+            else
+                AssertRC(rc); /* can be ignored in release builds. */
+        }
+
+        /*
          * Pump the data thru.
          */
-        RTVFSIOSTREAM hVfsIosSrc = RTVfsObjToIoStream(hVfsObj);
         rc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(pUnixInfo->cbObject, _1M));
         if (RT_SUCCESS(rc))
@@ -641,6 +660,6 @@
 
     /*
-     * Set other attributes as requested  .
-     *                                    .
+     * Set other attributes as requested.
+     *
      * Note! File extraction does get here.
      */
@@ -931,4 +950,6 @@
              "    --dir-mode-and-mask <octal-mode>      (-A, -C, -d, -r, -u, -x)\n"
              "        Include the given access mode for directories.\n"
+             "    --read-ahead                          (-x)\n"
+             "        Enabled read ahead thread when extracting files.\n"
              "\n");
     RTPrintf("Standard Options:\n"
@@ -986,4 +1007,5 @@
         { "--dir-mode-or-mask",     RTZIPTARCMD_OPT_DIR_MODE_OR_MASK,   RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT },
         { "--format",               RTZIPTARCMD_OPT_FORMAT,             RTGETOPT_REQ_STRING },
+        { "--read-ahead",           RTZIPTARCMD_OPT_READ_AHEAD,         RTGETOPT_REQ_NOTHING },
     };
 
@@ -1134,4 +1156,8 @@
                 break;
 
+            case RTZIPTARCMD_OPT_READ_AHEAD:
+                Opts.fReadAhead = true;
+                break;
+
             /* Standard bits. */
             case 'h':
