content: package com.alibaba.sdk.android.oss.internal;
  
  import com.alibaba.sdk.android.oss.common.utils.CaseInsensitiveHashMap;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   * Created by jingdan on 2017/11/27.
   */
  
  abstract class HttpMessage {
      private Map<String, String> headers = new CaseInsensitiveHashMap<String, String>();
      private InputStream content;
      private long contentLength;
      private String stringBody;
  
      public Map<String, String> getHeaders() {
          return headers;
      }
  
      public void setHeaders(Map<String, String> headers) {
          if (this.headers == null) {
              this.headers = new CaseInsensitiveHashMap<String, String>();
          }
          if (this.headers != null && this.headers.size() > 0) {
              this.headers.clear();
          }
  
          this.headers.putAll(headers);
      }
  
      public void addHeader(String key, String value) {
          this.headers.put(key, value);
      }
  
      public InputStream getContent() {
          return content;
      }
  
      public void setContent(InputStream content) {
          this.content = content;
      }
  
      public String getStringBody() {
          return stringBody;
      }
  
      public void setStringBody(String stringBody) {
          this.stringBody = stringBody;
      }
  
      public long getContentLength() {
          return contentLength;
      }
  
      public void setContentLength(long contentLength) {
          this.contentLength = contentLength;
      }
  
      public void close() throws IOException {
          if (content != null) {
              content.close();
              content = null;
          }
      }
  }
  