Skip to content

Reference DataType #311

Closed Answered by jamesmudd
cnash asked this question in Q&A
Oct 11, 2021 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Some untested code that implements the workaround

public Object getDataFromReference(HdfFile hdfFile, long address) {
	return ((Dataset) recurseGroup(hdfFile, address)).getData();
}

private Node recurseGroup(Group group, long address) {
	for (Node node : group) {
		if(node.getAddress() == address)  {
			return node;
		} else if (node instanceof Group) {
			recurseGroup((Group) node, address);
		}
	}
	throw new RuntimeException("Didn't find reference");
}

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@cnash
Comment options

Comment options

You must be logged in to vote
2 replies
@cnash
Comment options

@cnash
Comment options

Answer selected by cnash
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants