如何将byte []转换为InputStream? [英] How to convert byte[] to InputStream?
本文介绍了如何将byte []转换为InputStream?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一种方法可以将一个字节数组( byte []
)转换为Java中的InputStream?我查看了Apache Commons IO中的一些方法,但没有找到任何方法。
There is a way to convert an array of bytes (byte[]
) to InputStream in Java? I looked at some methods in Apache Commons IO, but found nothing.
推荐答案
ByteArrayInputStream
扩展 InputStream
:
InputStream myInputStream = new ByteArrayInputStream(myBytes);
这篇关于如何将byte []转换为InputStream?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文