Beispiel #1
0
 public boolean isEmpty() {
   return later == null
       && // No later using our bins
       in.isEmpty()
       && // No data
       meter.isEmpty(); // No responsibility to do more
 }
Beispiel #2
0
 public void start() {
   if (closed()) return;
   if (!meter.isDone() && later == null && in.hasData())
     later = new UploadTask(update, socket, meter.remain(), in);
 }
Beispiel #3
0
 /** Make an UploadValve that will upload data into socket. */
 public UploadValve(Update update, Socket socket, Range range) {
   this.update = update;
   this.socket = socket;
   meter = new Meter(range);
   in = Bin.medium();
 }