View Javadoc
1   package com.foxinmy.weixin4j.http;
2   
3   import java.io.ByteArrayInputStream;
4   import java.io.InputStream;
5   
6   /**
7    * 
8    * @className AbstractHttpResponse
9    * @author jinyu(foxinmy@gmail.com)
10   * @date 2015年9月7日
11   * @since JDK 1.6
12   * @see
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  }