Java Manifest Create loadManifest(byte[] bytes)

Here you can find the source of loadManifest(byte[] bytes)

Description

Load a java manifest file.

License

Open Source License

Parameter

Parameter Description
bytes The manifest file's content

Exception

Parameter Description
IOException an exception

Return

The manifest in object oriented model.

Declaration

public static Manifest loadManifest(byte[] bytes) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.ByteArrayInputStream;

import java.io.IOException;

import java.util.jar.Manifest;

public class Main {
    /**//www  . j  a v  a 2  s  . c  o m
     * Load a java manifest file.
     * 
     * @param bytes
     *            The manifest file's content
     * @return The manifest in object oriented model.
     * @throws IOException
     */
    public static Manifest loadManifest(byte[] bytes) throws IOException {
        ByteArrayInputStream fis = new ByteArrayInputStream(bytes);
        try {
            Manifest mf = new Manifest(fis);
            return mf;
        } finally {
            fis.close();
        }

    }
}

Related

  1. load(final InputStream stream)