转换的InputStream的FileInputStream? [英] Converting inputStream to FileInputStream?

查看:1225
本文介绍了转换的InputStream的FileInputStream?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个问题 - 我需要阅读SecretKey的从安卓APK(如key.keystore),我的应用程序它必须被理解为一个FileInputStream,但是从资产我只得到的InputStream。如何为InputStream转换成的FileInputStream?或者有没有其他的办法,如何从存取权限,例如文件资源为一个FileInputStream?

I am in a problem - i need to read SecretKey from Android APK (e.g. key.keystore), for my app it has to be read as a FileInputStream, but from assets I am getting only inputStream. How to convert inputStream to FileInputStream? Or is there any other way, how to acces file from e.g. resources as a fileInputStream?

感谢

推荐答案

为什么需要一个FileInputStream具体一点吗?一般情况下,你不必关心的InputStream的底层实现,你只是从它读。也许的的实施应该是不可知的InputStream

Why do you need a FileInputStream specifically? In general, you don't have to care about the underlying implementation of the InputStream, you just read from it. Maybe your implementation should be InputStream agnostic.

这篇关于转换的InputStream的FileInputStream?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆