gpt4 book ai didi

com.badlogic.gdx.backends.android.ZipResourceFile.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 15:23:31 27 4
gpt4 key购买 nike

本文整理了Java中com.badlogic.gdx.backends.android.ZipResourceFile.<init>()方法的一些代码示例,展示了ZipResourceFile.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipResourceFile.<init>()方法的具体详情如下:
包路径:com.badlogic.gdx.backends.android.ZipResourceFile
类名称:ZipResourceFile
方法名:<init>

ZipResourceFile.<init>介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

static public ZipResourceFile getResourceZipFile(String[] expansionFiles)
    throws IOException {
  ZipResourceFile apkExpansionFile = null;
  for (String expansionFilePath : expansionFiles) {
    if (null == apkExpansionFile) {
      apkExpansionFile = new ZipResourceFile(expansionFilePath);
    } else {
      apkExpansionFile.addPatchFile(expansionFilePath);
    }
  }
  return apkExpansionFile;
}

代码示例来源:origin: libgdx/libgdx

static public ZipResourceFile getResourceZipFile(String[] expansionFiles)
    throws IOException {
  ZipResourceFile apkExpansionFile = null;
  for (String expansionFilePath : expansionFiles) {
    if (null == apkExpansionFile) {
      apkExpansionFile = new ZipResourceFile(expansionFilePath);
    } else {
      apkExpansionFile.addPatchFile(expansionFilePath);
    }
  }
  return apkExpansionFile;
}

代码示例来源:origin: stackoverflow.com

ZipResourceFile expansionFile = new ZipResourceFile("myZipFile.zip");
AssetFileDescriptor assetFileDescriptor = expansionFile.getAssetFileDescriptor("myMusic.mp3");
try {
  mediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor());
  mediaPlayer.prepare();
  mediaPlayer.start();
}
catch (IOException e) {
  // Handle exception
}

代码示例来源:origin: stackoverflow.com

private static void setMediaPlayerDataSourceFromZip(MediaPlayer mediaPlayer,
    String zipFileName, String fileNameInZip) throws IOException,
    FileNotFoundException {
  ZipResourceFile zip = new ZipResourceFile(zipFileName);
  FileInputStream fis = new FileInputStream(zipFileName);
  try {
    FileDescriptor zipfd = fis.getFD();

    ZipEntryRO entry = zipFindFile(zip, fileNameInZip);
    mediaPlayer.setDataSource(zipfd, entry.mOffset,
        entry.mUncompressedLength);
  } finally {
    fis.close();
  }
}

private static ZipEntryRO zipFindFile(ZipResourceFile zip, String fileNameInZip) {
  for (ZipEntryRO entry : zip.getAllEntries()) {
    if (entry.mFileName.equals(fileNameInZip))
      return entry;
  }
  throw new RuntimeException(String.format("File \"%s\"not found in zip", fileNameInZip));
}

代码示例来源:origin: stackoverflow.com

ZipResourceFile zip = new ZipResourceFile(strMainPath);
InputStream iStream = zip.getInputStream("img1.jpg");

代码示例来源:origin: stackoverflow.com

for (String expansionFilePath : expansionFiles) {
  if ( null == apkExpansionFile ) {
    apkExpansionFile = new ZipResourceFile(expansionFilePath);
  } else {
    apkExpansionFile.addPatchFile(expansionFilePath);

代码示例来源:origin: stackoverflow.com

byte[] buf = new byte[1024 * 256];
try {
  zrf = new ZipResourceFile(fileName);
  ZipEntryRO[] entries = zrf.getAllEntries();

代码示例来源:origin: stackoverflow.com

ZipResourceFile expansionFile = new ZipResourceFile("myZipFile.zip");
AssetFileDescriptor assetFileDescriptor = expansionFile.getAssetFileDescriptor("myMusic.mp3");
try {
  mediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(),
               assetFileDescriptor.getStartOffset(),
               assetFileDescriptor.getLength());
  mediaPlayer.prepare();
  mediaPlayer.start();
}
catch (IOException e) {
  // Handle exception
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com