Skip to content

Commit 5c64993

Browse files
committed
public HttpNetWork method
1 parent fb6ad45 commit 5c64993

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

res/drawable-hdpi/ic_launcher.png

-9.18 KB
Binary file not shown.

res/drawable-ldpi/ic_launcher.png

-2.67 KB
Binary file not shown.

res/drawable-mdpi/ic_launcher.png

-5.11 KB
Binary file not shown.

res/drawable-xhdpi/ic_launcher.png

-14 KB
Binary file not shown.

src/com/wangjie/androidbucket/services/network/toolbox/HttpNetwork.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,21 @@ public class HttpNetwork implements Network<HippoHttpRequest<?>> {
3535

3636
private static int DEFAULT_POOL_SIZE = 4096;
3737

38-
private final ByteArrayPool mPool;
38+
private static final ByteArrayPool mPool = new ByteArrayPool(DEFAULT_POOL_SIZE);
3939

4040
/**
4141
* HttpClient
4242
*/
4343
private HttpClient httpClient;
4444

4545
public HttpNetwork(HttpClient httpClient) {
46-
this(new ByteArrayPool(DEFAULT_POOL_SIZE));
4746
this.httpClient = httpClient;
4847
}
4948

50-
private HttpNetwork(ByteArrayPool mPool) {
51-
this.mPool = mPool;
52-
}
53-
54-
5549
/**
5650
* Reads the contents of HttpEntity into a byte[].
5751
*/
58-
private byte[] entityToBytes(HttpEntity entity) throws IOException, HippoException {
52+
public static byte[] entityToBytes(HttpEntity entity) throws IOException, HippoException {
5953
PoolingByteArrayOutputStream bytes =
6054
new PoolingByteArrayOutputStream(mPool, (int) entity.getContentLength());
6155
byte[] buffer = null;

0 commit comments

Comments
 (0)