FSPADocumentPart.HEADER);
_fspaMain = new FSPATable(_tableStream, _fib, FSPADocumentPart.MAIN);
- if (_fib.getFcDggInfo() != 0) {
- _escherRecordHolder = new EscherRecordHolder(_tableStream, _fib.getFcDggInfo(), _fib.getLcbDggInfo());
- } else {
- _escherRecordHolder = new EscherRecordHolder();
- }
+ _escherRecordHolder = new EscherRecordHolder(_tableStream, _fib.getFcDggInfo(), _fib.getLcbDggInfo());
// read in the pictures stream
_pictures = new PicturesTable(this, _dataStream, _mainStream, _fspaMain, _escherRecordHolder);
*/
@Internal
public final class EscherRecordHolder {
- private final ArrayList<EscherRecord> escherRecords;
-
- public EscherRecordHolder() {
- escherRecords = new ArrayList<>();
- }
+ private final ArrayList<EscherRecord> escherRecords = new ArrayList<>();
public EscherRecordHolder(byte[] data, int offset, int size) {
- this();
fillEscherRecords(data, offset, size);
}
+ /**
+ * Parses the records out of the given data.
+ *
+ * The thing to be aware of here is that if {@code size} is {@code 0}, the document does not contain images.
+ *
+ * @see FileInformationBlock#getLcbDggInfo()
+ */
private void fillEscherRecords(byte[] data, int offset, int size)
{
+ if (size == 0) return;
+
EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
int pos = offset;
while ( pos < offset + size)
return escherRecords;
}
+ @Override
public String toString() {
StringBuilder buffer = new StringBuilder();