編輯:關於android開發
1 import java.io.BufferedInputStream;
2 import java.io.ByteArrayOutputStream;
3 import java.io.InputStream;
4 import java.net.HttpURLConnection;
5 import java.net.URL;
6
7 public class ReadURLUtil {
8
9 public static byte[] loadRawDataFromURL(String u) throws Exception {
10 URL url = new URL(u);
11 HttpURLConnection conn = (HttpURLConnection) url.openConnection();
12
13 InputStream is = conn.getInputStream();
14 BufferedInputStream bis = new BufferedInputStream(is);
15
16 ByteArrayOutputStream baos = new ByteArrayOutputStream();
17 // 緩存2KB
18 final int BUFFER_SIZE = 2 * 1024;
19 final int EOF = -1;
20
21 int c;
22 byte[] buf = new byte[BUFFER_SIZE];
23
24 while (true) {
25 c = bis.read(buf);
26 if (c == EOF)
27 break;
28
29 baos.write(buf, 0, c);
30 }
31
32 conn.disconnect();
33 is.close();
34
35 byte[] data = baos.toByteArray();
36 baos.flush();
37
38 return data;
39 }
40
41 }
(轉)Android SlidingTabLayout定制分割線和指示條顏色,android分割線
(轉)Android SlidingTabLayout定制分割線和指示條顏色,android分割線本文轉載與:http://blog.csdn.net/zhangphil
電信網絡拓撲圖自動布局
電信網絡拓撲圖自動布局在電信網絡拓撲圖中,很經常需要用到自動布局的功能,在大數據的層級關系中,通過手工一個一個擺放位置是不太現實的,工作量是相當大的,那麼就有了自動布局這
Android 手機衛士12--進程管理,android12--
Android 手機衛士12--進程管理,android12-- 1.本進程不能被選中,所以先將checkbox隱藏掉--手機衛士 不能自殺 if(getItem(po
QQ5.0側滑,qq5.0
QQ5.0側滑,qq5.0package com.example; import android.os.Bundle; import android.support.v7