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/lzma_encoder.h b/aos/events/logging/lzma_encoder.h
index bbd739a..b4964fb 100644
--- a/aos/events/logging/lzma_encoder.h
+++ b/aos/events/logging/lzma_encoder.h
@@ -37,7 +37,8 @@
     // space.
     return true;
   }
-  void Encode(Copier *copy) final;
+  size_t space() const final { return input_buffer_.capacity(); }
+  size_t Encode(Copier *copy, size_t start_byte) final;
   void Finish() final;
   void Clear(int n) final;
   absl::Span<const absl::Span<const uint8_t>> queue() final;