Class ZippedAssetPackage

java.lang.Object
com.massifmaps.utils.AssetPackage
com.massifmaps.utils.ZippedAssetPackage

public class ZippedAssetPackage extends AssetPackage
An asset package based on ZIP archived.
Only deflate-based ZIP archives are supported.
  • Constructor Details

    • ZippedAssetPackage

      public ZippedAssetPackage(BinaryData zipData)
      Constructs a ZIP asset package from the archived binary data.
      Parameters:
      zipData - The ZIP archive.
    • ZippedAssetPackage

      public ZippedAssetPackage(BinaryData zipData, AssetPackage baseAssetPackage)
      Constructs a ZIP asset package from the archived binary data and a fallback asset package.
      Parameters:
      zipData - The ZIP archive.
      baseAssetPackage - The base asset package. If an asset is not found in the ZIP archive, base asset package is used.
  • Method Details

    • getLocalAssetNames

      public StringVector getLocalAssetNames()
    • getAssetNames

      public StringVector getAssetNames()
      Description copied from class: AssetPackage
      Returns list of assets in the asset package.
      All listed assets can read using loadAsset API.
      Overrides:
      getAssetNames in class AssetPackage
      Returns:
      List of asset names.
    • loadAsset

      public BinaryData loadAsset(String name)
      Description copied from class: AssetPackage
      Loads the specified asset from the asset package.
      Overrides:
      loadAsset in class AssetPackage
      Parameters:
      name - The asset name to read.
      Returns:
      Asset data, if the asset exists and was successfully read. Null pointer otherwise.