os.write(buf, 0, readBytes);
}
- os.close();
+ // If this is an empty document, write a single byte
+ // to force a block allocation for this document
+ if (length == 0) os.write(0);
+ // Tidy and return the length
+ os.close();
return length;
}
import org.apache.poi.poifs.property.RootProperty;
import org.apache.poi.poifs.storage.HeaderBlock;
import org.apache.poi.util.IOUtils;
-import org.junit.Ignore;
import org.junit.Test;
/**
assertContentsMatches(main4106, normDoc);
}
- @Ignore
@Test
public void writeZeroLengthEntries() throws Exception {
NPOIFSFileSystem fs = new NPOIFSFileSystem();
// Save and re-check
fs = writeOutAndReadBack(fs);
+ testDir = fs.getRoot();
miniDoc = (DocumentEntry)testDir.getEntry("Mini2");
assertContentsMatches(mini2, miniDoc);