ByteArrayInputStream 转 InputStream
时间: 2023-10-22 11:27:34 浏览: 100
要将ByteArrayInputStream转换为InputStream,可以直接使用ByteArrayInputStream类的对象作为InputStream的参数。因为ByteArrayInputStream是InputStream的子类,所以可以直接进行类型转换。 例如,可以使用以下代码将ByteArrayInputStream对象转换为InputStream对象:
InputStream input = byteInputStream;
其中,byteInputStream是ByteArrayInputStream类的对象。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [byte[]和InputStream的相互转换](https://blog.csdn.net/liuxiao723846/article/details/53509538)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [ByteArrayInputStream简介和使用_动力节点Java学院整理](https://download.csdn.net/download/weixin_38646645/12780813)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文