/** The executor service. */
private final ExecutorService executorService;
+ /** The number of copied bytes. */
+ private long counter;
+
/**
* Creates a new connection.
*
}
//
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the number of bytes that this connection has received from its
+ * source during its lifetime.
+ *
+ * @return The number of processed input bytes
+ */
+ public long counter() {
+ return counter;
+ }
+
+ //
// ACTIONS
//
for (Future<Void> future : futures) {
future.get();
}
+ counter += buffer.length;
} catch (IOException e) {
/* TODO */
e.printStackTrace();