As far as I remember, the DcmDicomDir class only works on files (because of the internally used file/byte offsets). Of course, you can read an instance of the Basic Directory IOD into a DcmFileFormat or DcmDataset from a stream but then there would be no support for the Directory Record hierarchy (which is based on the before-mentioned byte offsets).
It should also be possible to enhance the DcmDicomDir class (and its underlying classes) in order to support reading from an input stream... the class apparently has not been designed having this in mind.
As far as I can see, the class DcmDicomDir has not been enhanced in this regard. The reason is that no one from our team apparently needed this feature for his own work and also no DCMTK user contributed it or sponsored development of it.