static Callable<LocalImage> retrieveTarLayersStep(
      BuildContext buildContext,
      ProgressEventDispatcher.Factory progressEventDispatcherFactory,
      Path tarPath,
      TempDirectoryProvider tempDirectoryProvider) {
    return () -> {
      LocalImage localImage =
          cacheDockerImageTar(
              buildContext, tarPath, progressEventDispatcherFactory, tempDirectoryProvider);
      PlatformChecker.checkManifestPlatform(buildContext, localImage.configurationTemplate);
      return localImage;
    };
  }
Checks the first two bytes of a file to see if it has been gzipped.

@param path the file to check
@return {@code true} if the file is gzipped, {@code false} if not
@throws IOException if reading the file fails
@see <a href="http://www.zlib.org/rfc-gzip.html#file-format">GZIP file format</a>
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/LocalBaseImageSteps.java