/*
 * Copyright (c) 2015-present, Parse, LLC.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
package com.parse;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * The base interface of a http body.It can be implemented by different http library such as
 * Apache http, Android URLConnection, Square OKHttp and so on.
 */
/** package */ abstract class ParseHttpBody {
  protected final String contentType;
  protected final long contentLength;

  public abstract InputStream getContent() throws IOException;
  public abstract void writeTo(OutputStream out) throws IOException;

  public ParseHttpBody(String contentType, long contentLength) {
    this.contentType = contentType;
    this.contentLength = contentLength;
  }

  public long getContentLength() {
    return contentLength;
  }

  public String getContentType() {
    return contentType;
  }
}

@@ -445,16 +445,17 @@
 tp body.
+ 
 It can b
@@ -492,17 +492,19 @@
 p librar
-y
+ies
  such as
@@ -701,350 +701,1151 @@
 %0A%0A  
-public abstract InputStream getContent() throws IOException;%0A  public abstract void writeTo(OutputStream out) throws IOException;%0A%0A  public ParseHttpBody(String contentType, long contentLength) %7B%0A    this.contentType = contentType;%0A    this.contentLength = contentLength;%0A  %7D%0A%0A  public long getContentLength() %7B%0A    return contentLength;%0A  %7D%0A
+/**%0A   * Returns the content of this body.%0A   *%0A   * @return The content of this body.%0A   * @throws IOException%0A   *           Throws an exception if the content of this body is inaccessible.%0A   */%0A  public abstract InputStream getContent() throws IOException;%0A%0A  /**%0A   * Writes the content of this request to %7B@code out%7D.%0A   *%0A   * @param out%0A   *          The outputStream the content of this body needs to be written to.%0A   * @throws IOException%0A   *           Throws an exception if the content of this body can not be written to %7B@code out%7D.%0A   */%0A  public abstract void writeTo(OutputStream out) throws IOException;%0A%0A  public ParseHttpBody(String contentType, long contentLength) %7B%0A    this.contentType = contentType;%0A    this.contentLength = contentLength;%0A  %7D%0A%0A  /**%0A   * Returns the number of bytes which will be written to %7B@code out%7D when %7B@link #writeTo%7D is%0A   * called, or -1 if that count is unknown.%0A   *%0A   * @return The Content-Length of this body.%0A   */%0A  public long getContentLength() %7B%0A    return contentLength;%0A  %7D%0A%0A  /**%0A   * Returns the Content-Type of this body.%0A   *%0A   * @return The Content-Type of this body.%0A   */
 %0A  p

Add comment for ParseHttpBody