java_gen: add PrimitiveSinkUtils

Reviewer: @meiyangbigswitch