global.namespace.archive.io.bios.JarOutputStreamAdapter Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2013-2018 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package global.namespace.archive.io.bios;
import global.namespace.archive.io.api.ArchiveEntrySink;
import global.namespace.archive.io.api.ArchiveFileOutput;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
/**
* Adapts a {@link JarOutputStream} to an {@link ArchiveFileOutput}.
*
* @author Christian Schlichtherle
*/
final class JarOutputStreamAdapter extends ZipOutputStreamAdapter {
JarOutputStreamAdapter(JarOutputStream jar) { super(jar); }
/** Returns {@code true}. */
@Override
public boolean isJar() { return true; }
@Override
public ArchiveEntrySink sink(String name) { return sink(new JarEntry(name)); }
}