ZFile implements Closeable { public void touch() { mDirty = true; } ZFile(@NonNull File file);  ZFile(@NonNull File file, @NonNull ZFileOptions options); @NonNull Set<StoredEntry> entries(); @Nullable StoredEntry get(@NonNull String path); @NonNull InputStream directOpen(final long start, final long end); void update(); @Override void close(); @NonNull byte[] getCentralDirectoryBytes(); @NonNull byte[] getEocdBytes(); void openReadOnly(); void add(@NonNull String name, @NonNull InputStream stream); void add(@NonNull String name, @NonNull InputStream stream, boolean mayCompress); void mergeFrom(@NonNull ZFile src, @NonNull Predicate<String> ignoreFilter); void touch(); void finishAllBackgroundTasks(); boolean realign(); void addZFileExtension(@NonNull ZFileExtension extension); void removeZFileExtension(@NonNull ZFileExtension extension); void directWrite(long offset, @NonNull byte[] data, int start, int count); void directWrite(long offset, @NonNull byte[] data); int directRead(long offset, @NonNull byte[] data, int start, int count); int directRead(long offset, @NonNull byte[] data); void directFullyRead(long offset, @NonNull byte[] data); void addAllRecursively(@NonNull File file); void addAllRecursively(@NonNull File file,
            @NonNull Function<? super File, Boolean> mayCompress); long getCentralDirectoryOffset(); long getCentralDirectorySize(); long getEocdOffset(); long getEocdSize(); void setExtraDirectoryOffset(long offset); long getExtraDirectoryOffset(); boolean areTimestampsIgnored(); void sortZipContents(); @NonNull File getFile(); static final char SEPARATOR; }
@Test public void readNonExistingFile() throws Exception { File temporaryDir = mTemporaryFolder.getRoot(); File zf = new File(temporaryDir, "a"); try (ZFile azf = new ZFile(zf)) { azf.touch(); } assertTrue(zf.exists()); }