2362N/A * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The <code>JarOutputStream</code> class is used to write the contents 0N/A * of a JAR file to any output stream. It extends the class 0N/A * <code>java.util.zip.ZipOutputStream</code> with support 0N/A * for writing an optional <code>Manifest</code> entry. The 0N/A * <code>Manifest</code> can be used to specify meta-information about 0N/A * the JAR file and its entries. 0N/A * @author David Connelly 0N/A * @see java.util.zip.ZipOutputStream 0N/A * Creates a new <code>JarOutputStream</code> with the specified 0N/A * <code>Manifest</code>. The manifest is written as the first 0N/A * entry to the output stream. 0N/A * @param out the actual output stream 0N/A * @param man the optional <code>Manifest</code> 0N/A * @exception IOException if an I/O error has occurred 0N/A * Creates a new <code>JarOutputStream</code> with no manifest. 0N/A * @param out the actual output stream 0N/A * @exception IOException if an I/O error has occurred 0N/A * Begins writing a new JAR file entry and positions the stream 0N/A * to the start of the entry data. This method will also close 0N/A * any previous entry. The default compression method will be 0N/A * used if no compression method was specified for the entry. 0N/A * The current time will be used if the entry has no set modification 0N/A * @exception ZipException if a ZIP error has occurred 0N/A * @exception IOException if an I/O error has occurred 0N/A // Make sure that extra field data for first JAR 0N/A // entry includes JAR magic number id. 0N/A // Prepend magic to existing extra data 0N/A * Returns true if specified byte array contains the 0N/A * jar magic extra field id. 0N/A // Invalid extra field data 0N/A * Fetches unsigned 16-bit value from byte array at specified offset. 0N/A * The bytes are assumed to be in Intel (little-endian) byte order. 0N/A return (b[
off] &
0xff) | ((b[
off+
1] &
0xff) <<
8);
0N/A * Sets 16-bit value at specified offset. The bytes are assumed to 0N/A * be in Intel (little-endian) byte order.