// Path: measures/src/main/java/io/apisense/network/MeasurementError.java
// public class MeasurementError extends Exception {
//   public final String taskName;
// 
//   public MeasurementError(String taskName, String reason) {
//     super(reason);
//     this.taskName = taskName;
//   }
// 
//   public MeasurementError(String taskName, String reason, Throwable e) {
//     super(reason, e);
//     this.taskName = taskName;
//   }
// 
//   public MeasurementError(String taskName, Exception e) {
//     this(taskName, e.getMessage(), e);
//   }
// }
// 
// Path: measures/src/main/java/io/apisense/network/MeasurementResult.java
// public abstract class MeasurementResult {
//   /**
//    * Name of the task (ie TCP download, Traceroute, etc)
//    */
//   private final String taskName;
// 
//   /**
//    * Time of the beginning of the task in milliseconds
//    */
//   private final long startTime;
// 
//   /**
//    * Time of the end of the task in milliseconds
//    */
//   private final long endTime;
// 
//   /**
//    * Number of milliseconds representing the duration of the task
//    */
//   private final long duration;
// 
//   protected MeasurementResult(String taskName, long startTime, long endTime) {
//     this.taskName = taskName;
//     this.startTime = startTime;
//     this.endTime = endTime;
//     this.duration = endTime - startTime;
//   }
// 
//   public String getTaskName() {
//     return taskName;
//   }
// 
//   public long getStartTime() {
//     return startTime;
//   }
// 
//   public long getEndTime() {
//     return endTime;
//   }
// 
//   public long getDuration() {
//     return duration;
//   }
// 
//   @Override
//   public String toString() {
//     return "MeasurementResult{" +
//         "taskName='" + taskName + '\'' +
//         ", startTime=" + startTime +
//         ", endTime=" + endTime +
//         ", duration=" + duration +
//         '}';
//   }
// }


import android.support.annotation.NonNull;
import android.util.Log;
import java.io.IOException;
import java.net.DatagramSocket;
import io.apisense.network.MeasurementError;
import io.apisense.network.MeasurementResult;
package io.apisense.network.udp;




/**
 * Measurement class used to realise an UDP upload burst
 * Measures the jitter, the jitter, the loss, and the number of out of order packets in upload
 */
public class UDPUploadBurstTask extends UDPBurstTask {
  private static final String TAG = "UDPUploadBurst";

  public UDPUploadBurstTask(UDPBurstConfig udpBurstConfig) {
    super(TAG, udpBurstConfig);
  }

  /**
   * {@inheritDoc}
   *
   * @return A {@link UDPBurstResult} object containing information on the UDP upload burst.
   * @throws MeasurementError {@inheritDoc}
   */
// Path: measures/src/main/java/io/apisense/network/MeasurementError.java
// public class MeasurementError extends Exception {
//   public final String taskName;
// 
//   public MeasurementError(String taskName, String reason) {
//     super(reason);
//     this.taskName = taskName;
//   }
// 
//   public MeasurementError(String taskName, String reason, Throwable e) {
//     super(reason, e);
//     this.taskName = taskName;
//   }
// 
//   public MeasurementError(String taskName, Exception e) {
//     this(taskName, e.getMessage(), e);
//   }
// }
// 
// Path: measures/src/main/java/io/apisense/network/MeasurementResult.java
// public abstract class MeasurementResult {
//   /**
//    * Name of the task (ie TCP download, Traceroute, etc)
//    */
//   private final String taskName;
// 
//   /**
//    * Time of the beginning of the task in milliseconds
//    */
//   private final long startTime;
// 
//   /**
//    * Time of the end of the task in milliseconds
//    */
//   private final long endTime;
// 
//   /**
//    * Number of milliseconds representing the duration of the task
//    */
//   private final long duration;
// 
//   protected MeasurementResult(String taskName, long startTime, long endTime) {
//     this.taskName = taskName;
//     this.startTime = startTime;
//     this.endTime = endTime;
//     this.duration = endTime - startTime;
//   }
// 
//   public String getTaskName() {
//     return taskName;
//   }
// 
//   public long getStartTime() {
//     return startTime;
//   }
// 
//   public long getEndTime() {
//     return endTime;
//   }
// 
//   public long getDuration() {
//     return duration;
//   }
// 
//   @Override
//   public String toString() {
//     return "MeasurementResult{" +
//         "taskName='" + taskName + '\'' +
//         ", startTime=" + startTime +
//         ", endTime=" + endTime +
//         ", duration=" + duration +
//         '}';
//   }
// }


// Path: measures/src/main/java/io/apisense/network/udp/UDPUploadBurstTask.java
import android.support.annotation.NonNull;
import android.util.Log;
import java.io.IOException;
import java.net.DatagramSocket;
import io.apisense.network.MeasurementError;
import io.apisense.network.MeasurementResult;

package io.apisense.network.udp;




/**
 * Measurement class used to realise an UDP upload burst
 * Measures the jitter, the jitter, the loss, and the number of out of order packets in upload
 */
public class UDPUploadBurstTask extends UDPBurstTask {
  private static final String TAG = "UDPUploadBurst";

  public UDPUploadBurstTask(UDPBurstConfig udpBurstConfig) {
    super(TAG, udpBurstConfig);
  }

  /**
   * {@inheritDoc}
   *
   * @return A {@link UDPBurstResult} object containing information on the UDP upload burst.
   * @throws MeasurementError {@inheritDoc}
   */
  public MeasurementResult execute() throws MeasurementError {