/// <exception cref="System.IO.IOException"/> internal void LoadINodeDirectorySection(InputStream @in) { IList <INodeReference> refList = parent.GetLoaderContext().GetRefList(); while (true) { FsImageProto.INodeDirectorySection.DirEntry e = FsImageProto.INodeDirectorySection.DirEntry .ParseDelimitedFrom(@in); // note that in is a LimitedInputStream if (e == null) { break; } INodeDirectory p = dir.GetInode(e.GetParent()).AsDirectory(); foreach (long id in e.GetChildrenList()) { INode child = dir.GetInode(id); AddToParent(p, child); } foreach (int refId in e.GetRefChildrenList()) { INodeReference @ref = refList[refId]; AddToParent(p, @ref); } } }
/// <exception cref="System.IO.IOException"/> private void DumpINodeDirectorySection(InputStream @in) { @out.Write("<INodeDirectorySection>"); while (true) { FsImageProto.INodeDirectorySection.DirEntry e = FsImageProto.INodeDirectorySection.DirEntry .ParseDelimitedFrom(@in); // note that in is a LimitedInputStream if (e == null) { break; } @out.Write("<directory>"); O("parent", e.GetParent()); foreach (long id in e.GetChildrenList()) { O("inode", id); } foreach (int refId in e.GetRefChildrenList()) { O("inodereference-index", refId); } @out.Write("</directory>\n"); } @out.Write("</INodeDirectorySection>\n"); }