URL imageUrl = new URL("http://192.168.0.103:8080/mm/showImage?id=2&fileName=fesc1cc.JPG&imgType=books");
//URL imageUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection) imageUrl
.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
StringBuffer buffer = new StringBuffer();
String inputLine;
while ((inputLine = in.readLine()) != null)
buffer.append(inputLine);
in.close();
conn.getResponseCode();
System.out.println(conn.getResponseCode());
System.out.println(buffer.toString());
conn.disconnect();
如何將我接收的數據轉換爲位圖並將其顯示在圖像視圖中。如何將原始數據轉換爲位圖?
的可能的複製[如何字節數組位圖轉換(http://stackoverflow.com/questions/7620401/how-to-convert-byte-array-to位圖) –