static Callable<ImagesAndRegistryClient> returnImageAndRegistryClientStep(
      List<PreparedLayer> layers, ContainerConfigurationTemplate configurationTemplate) {
    return () -> {
      // Collect compressed layers and add to manifest
      V22ManifestTemplate v22Manifest = new V22ManifestTemplate();
      for (PreparedLayer layer : layers) {
        BlobDescriptor descriptor = layer.getBlobDescriptor();
        v22Manifest.addLayer(descriptor.getSize(), descriptor.getDigest());
      }

      BlobDescriptor configDescriptor = Digests.computeDigest(configurationTemplate);
      v22Manifest.setContainerConfiguration(
          configDescriptor.getSize(), configDescriptor.getDigest());
      return new ImagesAndRegistryClient(
          Collections.singletonList(
              JsonToImageTranslator.toImage(v22Manifest, configurationTemplate)),
          null);
    };
  }
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