throws IOException
{
FileInputStream fin = new FileInputStream(file);
POIFSFileSystem poifs = new POIFSFileSystem(fin);
InputStream din = poifs.createDocumentInputStream("Workbook");
RecordInputStream rinp = new RecordInputStream(din);
while(rinp.hasNextRecord()) {
int sid = rinp.getNextSid();
rinp.nextRecord();
int size = rinp.available();
Class<? extends Record> clz = RecordFactory.getRecordClass(sid);
System.out.print(
formatSID(sid) +
" - " +
formatSize(size) +
" bytes"
);
if(clz != null) {
System.out.print(" \t");
System.out.print(clz.getName().replace("org.apache.poi.hssf.record.", ""));
}
System.out.println();
byte[] data = rinp.readRemainder();
if(data.length > 0) {
System.out.print(" ");
System.out.println( formatData(data) );
}
}