35 /**
36 * This is OBSOLETE. DO NOT USE THIS. Use java.util.jar.Manifest
37 * instead. It has to stay here because some apps (namely HJ and HJV)
38 * call directly into it.
39 *
40 * @author David Brown
41 * @author Benjamin Renaud
42 */
43
44 public class Manifest {
45
46 /* list of headers that all pertain to a particular
47 * file in the archive
48 */
49 private Vector<MessageHeader> entries = new Vector<>();
50 private byte[] tmpbuf = new byte[512];
51 /* a hashtable of entries, for fast lookup */
52 private Hashtable<String, MessageHeader> tableEntries = new Hashtable<>();
53
54 static final String[] hashes = {"SHA"};
55 static final byte[] EOL = {(byte)'\r', (byte)'\n'};
56
57 static final boolean debug = false;
58 static final String VERSION = "1.0";
59 static final void debug(String s) {
60 if (debug)
61 System.out.println("man> " + s);
62 }
63
64 public Manifest() {}
65
66 public Manifest(byte[] bytes) throws IOException {
67 this(new ByteArrayInputStream(bytes), false);
68 }
69
70 public Manifest(InputStream is) throws IOException {
71 this(is, true);
72 }
73
74 /**
75 * Parse a manifest from a stream, optionally computing hashes
|
35 /**
36 * This is OBSOLETE. DO NOT USE THIS. Use java.util.jar.Manifest
37 * instead. It has to stay here because some apps (namely HJ and HJV)
38 * call directly into it.
39 *
40 * @author David Brown
41 * @author Benjamin Renaud
42 */
43
44 public class Manifest {
45
46 /* list of headers that all pertain to a particular
47 * file in the archive
48 */
49 private Vector<MessageHeader> entries = new Vector<>();
50 private byte[] tmpbuf = new byte[512];
51 /* a hashtable of entries, for fast lookup */
52 private Hashtable<String, MessageHeader> tableEntries = new Hashtable<>();
53
54 static final String[] hashes = {"SHA"};
55
56 static final boolean debug = false;
57 static final String VERSION = "1.0";
58 static final void debug(String s) {
59 if (debug)
60 System.out.println("man> " + s);
61 }
62
63 public Manifest() {}
64
65 public Manifest(byte[] bytes) throws IOException {
66 this(new ByteArrayInputStream(bytes), false);
67 }
68
69 public Manifest(InputStream is) throws IOException {
70 this(is, true);
71 }
72
73 /**
74 * Parse a manifest from a stream, optionally computing hashes
|