Duplicate :
|
|
Relates :
|
|
Relates :
|
Jar Manifest Specifiction: newline : CR LF | LF | CR (not followed by LF) Test case: ------------------------------------------------------------- byte[] mbytes = ("Manifest-Version: 1.0\r\n" + "Created-By: 1.9.0-internal (Oracle Corporation)\r\n" + "key1: value1\n" + "key2: value2\r" + "key3: value3\r\n" + "key4: value4\n E\r\n" + "key5: value5\r\n E\r\n" + "key6: value6\r E\r\n" + "key7: value7\r \r\n" + "key8: value8 \r \r\n" ).getBytes(); Manifest m = new Manifest(new ByteArrayInputStream(mbytes)); Attributes attr = m.getMainAttributes(); System.out.println(" attr: "); attr.forEach((k, v) -> System.out.println("[" + k + "] : [" + v + "]")); System.out.println(" ----------------------"); ----------------------------------------------------------------
|