With Apache Commons it is very simple to convert InputStream
to byte[]
,
static byte[] toByteArray(InputStream input)
but I can't find the opposite method. What's the most popular/straightforward way of converting array of bytes to InputStream object?
开发者_JS百科Thanks in advance.
Take a look at ByteArrayInputStream
精彩评论