0
我想使用jsp读取图像并通过http发送以便通过android应用程序访问。我尝试了JSP使用jsp从服务器下载android中的图像
代码是通过增加数据头
String strDirectory = "D://abc.jpg";
File fp = new File(strDirectory);
int length = (int)fp.length();
buffer = new byte[length];
FileInputStream f0 = new FileInputStream(fp);
f0.read(buffer);
f0.close();
response.addHeader("image_data",new String(buffer));
我不知道这是否是正确的。 什么是从jsp页面发送图像字节到android应用程序的正确方式
如何在Android应用程序中读取 – abhinav 2013-05-01 01:54:03
在Android中,您可以获取inputStream并将其读取 – FrancescoAzzola 2013-05-02 07:15:43
thankyou it worked..before this just just out.println()and read i吨在Android ..它没有工作..你可以告诉我为什么?是因为只能打印ASCII字符 – abhinav 2013-05-02 08:45:25