CPIOArchiveInputStream cpioIn = new CPIOArchiveInputStream( new FileInputStream(new File("test.cpio"))); CPIOArchiveEntry cpioEntry; while ((cpioEntry = cpioIn.getNextEntry()) != null) { System.out.println(cpioEntry.getName()); int tmp; StringBuilder buf = new StringBuilder(); while ((tmp = cpIn.read()) != -1) { buf.append((char) tmp); } System.out.println(buf.toString()); } cpioIn.close();
Note: This implementation should be compatible to cpio 2.5 This class uses mutable fields and is not considered to be threadsafe. Based on code from the jRPM project (jrpm.sourceforge.net)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|