作者:张火蓉景荣馨季 | 来源:互联网 | 2023-09-01 03:24
IvewritingaapplicationonAndroidwhichcallsa.NetrestfulwcfwebserviceIvewritten.Ims
I've writing a application on Android which calls a .Net restful wcf web service I've written. I'm successfully obtaining XML and String results, but cannot call a method on the web service which returns a byte[] - it looks like its encoding is alerted.
我在Android上编写了一个应用程序,它调用了我编写的.Net restful wcf web服务。我成功地获取了XML和String结果,但无法调用返回byte []的Web服务上的方法 - 看起来它的编码已被警告。
I am using the org.apache.http.HttpHost library and an currently reading the byte[] as a string (the encoding in eclipse looks like unicode);
我正在使用org.apache.http.HttpHost库和当前正在读取byte []作为字符串(eclipse中的编码看起来像unicode);
InputStream in = response.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder str = new StringBuilder();
String line = null;
while((line = reader.readLine()) != null){
str.append(line);
}
in.close();
String asciiString = str.toString();
Basically I want to convert the data held in asciiString to a Bitmap (the WCF service outputs a byte[] of a PNG image)
基本上我想将asciiString中保存的数据转换为Bitmap(WCF服务输出PNG图像的byte [])
If anyone can offer pointers as what I am doing wrong or how to do this (if it is possible) it would be most welcome.
如果有人可以提供我正在做错的指示或如何做到这一点(如果可能的话),那将是非常受欢迎的。
Many thanks
1 个解决方案