ProtoOutputStream convenience methods.

- Add a set of write methods to ProtoOutputStream that figure out the type.
  The other methods are doing all the type checking anyway, so this won't be
  much slower, and it's way easier to use.  The expected java type casts
  that people would do anyway happen inside.
- Add writeObject and writeRepeatedObject methods that write a pre-encoded
  object.
- Add a constructor that takes an OutputStream, and a flush() method.  Right
  now, all the data gets flushed at the end, but given this API it would be
  possible to write smaller chunks at the object boundaries and do more
  sophisticated buffering.

Test: CTS
Change-Id: Ieb852092d3d65812c81139558151de9e3f467dc8
2 files changed