我有一个问题,在android上显示图像〜
我将尝试将转换后的文件发送到ByteArray到单个inputStream到android
我的计划是
BitmapFactory.decodeByteArray()
但未保存它们
(在Android上)Sever:
OutputStream outputstream = response.getOutputStream();
imageDownload_fewfiles aa = new imageDownload_fewfiles();
DataOutputStream outputstream2 = new DataOutputStream(outputstream);
outputstream2.writeBytes("!@###!@###");
outputstream2.write(aa.image_files());
outputstream2.writeBytes("!@###!@###");
android:
InputStream inputStream = http.getInputStream();
DataInputStream dataInputStream = new DataInputStream(http.getInputStream());
有可能吗?如果可能的话,我如何从inputStream获取每个byteArray?
请给我一些建议..我不想使用第三部分
答案 0 :(得分:0)
假设您正确获得输入流。
int length; // This should be get from the request.
byte[] array = new byte[length];
DataInputStream dataInputStream = new DataInputStream(inputStream);
dataInputStream.readFully(array);