use of org.apache.poi.hdgf.streams.ChunkStream in project poi by apache.
the class VSDDumper method dumpStream.
private void dumpStream(Stream stream, int indent) {
Pointer ptr = stream.getPointer();
dumpVal("Stream at", ptr.getOffset(), indent);
dumpVal("Type is", ptr.getType(), indent + 1);
dumpVal("Format is", ptr.getFormat(), indent + 1);
dumpVal("Length is", ptr.getLength(), indent + 1);
if (ptr.destinationCompressed()) {
dumpVal("DC.Length is", stream._getContentsLength(), indent + 1);
}
dumpVal("Compressed is", ptr.destinationCompressed(), indent + 1);
dumpVal("Stream is", stream.getClass().getName(), indent + 1);
byte[] db = stream._getStore()._getContents();
String ds = (db.length >= 8) ? Arrays.toString(db) : "[]";
dumpVal("First few bytes are", ds, indent + 1);
if (stream instanceof PointerContainingStream) {
Stream[] streams = ((PointerContainingStream) stream).getPointedToStreams();
dumpVal("Nbr of children", streams.length, indent + 1);
for (Stream s : streams) {
dumpStream(s, indent + 1);
}
}
if (stream instanceof ChunkStream) {
Chunk[] chunks = ((ChunkStream) stream).getChunks();
dumpVal("Nbr of chunks", chunks.length, indent + 1);
for (Chunk chunk : chunks) {
dumpChunk(chunk, indent + 1);
}
}
}
Aggregations