1 package com.foxinmy.weixin4j.http;
2
3 import java.io.ByteArrayInputStream;
4 import java.io.InputStream;
5
6
7
8
9
10
11
12
13
14 public abstract class AbstractHttpResponse implements HttpResponse {
15 protected final static String KEEP_ALIVE = "keep-alive";
16 private final byte[] content;
17
18 public AbstractHttpResponse(byte[] content) {
19 this.content = content;
20 }
21
22 @Override
23 public byte[] getContent() {
24 return content;
25 }
26
27 @Override
28 public InputStream getBody() {
29 return content != null ? new ByteArrayInputStream(content) : null;
30 }
31 }