/** * Called once the parent ChunkGroup has been populated, to match up the * Chunks in it with our Variable Sized Properties. */ protected void matchVariableSizedPropertiesToChunks() { // Index the Parent Group chunks for easy lookup // TODO Is this the right way? Map<Integer, Chunk> chunks = new HashMap<>(); for (Chunk chunk : parentGroup.getChunks()) { chunks.put(chunk.getChunkId(), chunk); } // Loop over our values, looking for chunk based ones for (PropertyValue val : properties.values()) { if (val instanceof ChunkBasedPropertyValue) { ChunkBasedPropertyValue cVal = (ChunkBasedPropertyValue) val; Chunk chunk = chunks.get(cVal.getProperty().id); // System.err.println(cVal.getProperty() + " = " + cVal + " -> " // + HexDump.toHex(cVal.data)); // TODO Make sense of the raw offset value if (chunk != null) { cVal.setValue(chunk); } else { logger.log(POILogger.WARN, "No chunk found matching Property " + cVal); } } } }
if (isPointer) { propVal = new ChunkBasedPropertyValue(prop, flags, data, type); } else if (type == Types.NULL) { propVal = new NullPropertyValue(prop, flags, data);