Make Copier and Encoder support writing partial messages

Along with changes to DummyEncoder, this gets us nicely setup to create
nice round buffer sizes for both DummyEncoder and LzmaEncoder.  Those
can be written using O_DIRECT in a follow on commit for much more
efficient IO.

To do this, we need to introduce both start and stop bytes to Copier,
and then teach Encoder how to return what it was able to encode, and
then to restart part way through a message.

--flush_size now sets the buffer size.

Change-Id: I7a26d2ce677a28bd0e73333514302dc0612195c2
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index 4e38feb..1dbcbd8 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -134,12 +134,13 @@
 
  private:
   // Performs a single writev call with as much of the data we have queued up as
-  // possible.
+  // possible.  now is the time we flushed at, to be recorded in
+  // last_flush_time_.
   //
   // This will normally take all of the data we have queued up, unless an
   // encoder has spit out a big enough chunk all at once that we can't manage
   // all of it.
-  void Flush();
+  void Flush(aos::monotonic_clock::time_point now);
 
   // write_return is what write(2) or writev(2) returned. write_size is the
   // number of bytes we expected it to write.