PrimitiveWriter: New API for writing parts of array.

Along with unit tests.