this should solve the problem of exception "java.io.IOException: read
failed: EBADF" when invoke getInputStream