You need to use the getMendixObject() method from the TestFile proxy.
inputStream = Core.getFileDocumentContent(getContext(), myobject.getMendixObject());
Hope this helps.
Answering my own question after playing around.
Instead of
inputStream = Core.getFileDocumentContent(getContext(), myobject);
I did this.
inputStream = Core.getFileDocumentContent(getContext(), __Parameter.get(a));
Seems weird since technically they should be the same thing, but it worked.