if(level == Attribute.LEVEL_END_OF_FILE) {
break;
}
// Build the attribute
Attribute attr = new Attribute(inp);
// Print the attribute into
System.out.println(
"Level " + level + " : Type " + attr.getType() +
" : ID " + attr.getId().toString()
);
// Print the contents
String indent = " ";
System.out.println(indent + "Data of length " + attr.getData().length);
if(attr.getData().length > 0) {
int len = attr.getData().length;
if(truncatePropertyData) {
len = Math.min( attr.getData().length, 48 );
}
int loops = len/16;
if(loops == 0) loops = 1;
for(int i=0; i<loops; i++) {
int thisLen = 16;
int offset = i*16;
if(i == loops-1) {
thisLen = len - offset;
}
byte data[] = new byte[thisLen];
System.arraycopy(attr.getData(), offset, data, 0, thisLen);
System.out.print(
indent + HexDump.dump(data, 0, 0)
);
}
}
System.out.println();
if(attr.getId() == Attribute.ID_MAPIPROPERTIES) {
List<MAPIAttribute> attrs = MAPIAttribute.create(attr);
for(MAPIAttribute ma : attrs) {
System.out.println(indent + indent + ma);
}
System.out.println();