将字节数组转换为InputStream
import java.io.ByteArrayInputStream; /** * n o w j a v a . c o m - 时代Java 提 供 **/ import java.io.IOException; import java.io.InputStream; public class ByteArrayToInputStream { public static final void main(String[] args) { String string = "this is a test"; byte[] content = string.getBytes(); int size = content.length; InputStream is = null; byte[] b = new byte[size]; try {//时 代 J a v a - nowjava.com 提 供 is = new ByteArrayInputStream(content); is.read(b); System.out.println(new String(b)); } catch (IOException e) { e.printStackTrace(); } finally { if (is != null) { try {