resources/src/main/java/org/robolectric/res/android/ZipFileRO.java
FileMap createEntryFileMap(ZipEntryRO entry)
  {
    // final _ZipEntryRO *zipEntry = reinterpret_cast<_ZipEntryRO*>(entry);
    // const ZipEntry& ze = zipEntry->entry;
    ZipEntry ze = entry.entry;
    // int fd = GetFileDescriptor(mHandle);
    int fd = -1;
    int actualLen = 0;

    if (ze.getMethod() == kCompressStored) {
      actualLen = toIntExact(ze.getSize());
    } else {
      actualLen = toIntExact(ze.getCompressedSize());
    }

    FileMap newMap = new FileMap();
    if (!newMap.createFromZip(mFileName, mHandle.zipFile, entry.entry, actualLen, true)) {
      // delete newMap;
      return null;
    }

    return newMap;
  }
FileMap createEntryFileMap(ZipEntryRO entry)
  {
    // final _ZipEntryRO *zipEntry = reinterpret_cast<_ZipEntryRO*>(entry);
    // const ZipEntry& ze = zipEntry->entry;
    ZipEntry ze = entry.entry;
    // int fd = GetFileDescriptor(mHandle);
    int fd = -1;
    int actualLen = 0;

    if (ze.getMethod() == kCompressStored) {
      actualLen = toIntExact(ze.getSize());
    } else {
      actualLen = toIntExact(ze.getCompressedSize());
    }

    FileMap newMap = new FileMap();
    if (!newMap.createFromZip(mFileName, mHandle.zipFile, entry.entry, actualLen, true)) {
      // delete newMap;
      return null;
    }

    return newMap;
  }
FileMap createEntryFileMap ( ZipEntryRO entry ) { // final _ZipEntryRO *zipEntry = reinterpret_cast<_ZipEntryRO*>(entry); // const ZipEntry& ze = zipEntry->entry; ZipEntry ze = entry . entry ; // int fd = GetFileDescriptor(mHandle); int fd = - 1 ; int actualLen = 0 ; if ( ze . getMethod ( ) == kCompressStored ) { actualLen = toIntExact ( ze . getSize ( ) ) ; } else { actualLen = toIntExact ( ze . getCompressedSize ( ) ) ; } FileMap newMap = new FileMap ( ) ; if ( ! newMap . createFromZip ( mFileName , mHandle . zipFile , entry . entry , actualLen , true ) ) { // delete newMap; return null ; } return newMap ; }
/*
Create a new FileMap object that spans the data in "entry".
/ * Create a new FileMap object that spans the data in entry .