simplify get HdfsInputStream logic in HdfsFileInputStream

simplify get HdfsInputStream logic in HdfsFileInputStream, add two functions to replace reused code.
Any JIRA or patch on this unit test? Thanks.