class ParseCountingFileHttpBody extends ParseFileHttpBody {

  @Override
  public void writeTo(OutputStream output) throws IOException {
    if (output == null) {
      throw new IllegalArgumentException("Output stream may not be null");
    }

    final FileInputStream fileInput = new FileInputStream(file);
    try {
      byte[] buffer = new byte[DEFAULT_CHUNK_SIZE];
      int n;
      long totalLength = file.length();
      long position = 0;
      while (EOF != (n = fileInput.read(buffer))) {
        output.write(buffer, 0, n);
        position += n;

        if (progressCallback != null) {
          int progress = (int) (100 * position / totalLength);
          progressCallback.done(progress);
        }
      }
    } finally {
      ParseIOUtils.closeQuietly(fileInput);
    }
  }

  public  ParseCountingFileHttpBody(File file, ProgressCallback progressCallback);
  public  ParseCountingFileHttpBody(
      File file, String contentType, ProgressCallback progressCallback);

}