Add WriteHashTree() to allow users process hashtree data themselves

Sometimes we may want to write hash tree data somewhere else other than
fd. For example, we may want to send hash tree data to CowWriter.
Currently there's no interface to do that, so we added a generate
WriteHashTree() so users can process the hashtree data themselves

Test: treehugger
Change-Id: I56258ee8497336abcb804facef017ed71b5c9415
2 files changed