/** * Returns an {@link InputStream} to read the postamble of this ZIP file. * <p> * Note that the returned stream is a <i>lightweight</i> stream, * i.e. there is no external resource such as a {@link ReadOnlyFile} * allocated for it. Instead, all streams returned by this method share * the underlying {@code ReadOnlyFile} of this {@code ZipFile}. * This allows to close this object (and hence the underlying * {@code ReadOnlyFile}) without cooperation of the returned * streams, which is important if the client application wants to work on * the underlying file again (e.g. update or delete it). * * @throws ZipException If this ZIP file has been closed. */ @CreatesObligation public InputStream getPostambleInputStream() throws IOException { rof(); return new ReadOnlyFileInputStream( new EntryReadOnlyFile(length - postamble, postamble)); }
/** * Returns an {@link InputStream} to read the preamble of this ZIP file. * <p> * Note that the returned stream is a <i>lightweight</i> stream, * i.e. there is no external resource such as a {@link ReadOnlyFile} * allocated for it. Instead, all streams returned by this method share * the underlying {@code ReadOnlyFile} of this {@code ZipFile}. * This allows to close this object (and hence the underlying * {@code ReadOnlyFile}) without cooperation of the returned * streams, which is important if the client application wants to work on * the underlying file again (e.g. update or delete it). * * @throws ZipException If this ZIP file has been closed. */ @CreatesObligation public InputStream getPreambleInputStream() throws IOException { rof(); return new ReadOnlyFileInputStream( new EntryReadOnlyFile(0, preamble)); }
final boolean process) throws IOException { final ReadOnlyFile rof = rof(); if (name == null) throw new NullPointerException();
final ReadOnlyFile rof = new SafeBufferedReadOnlyFile(rof(), length); while (0 < this.postamble) { long fp = length - postamble;