'Arrays are encoded as a series of blocks.
Each block consists of a long count value,
followed by that many array items.
A block with count zero indicates the end of the array.
Each item is encoded per the array\'s item schema.
If a block\'s count is negative,
then the count is followed immediately by a long block size,
indicating the number of bytes in the block.
The actual count in this case
is the absolute value of the count written.'

def write_array(self, writers_schema, datum, encoder):

    if (len(datum) > 0):
        encoder.write_long(len(datum))
        for item in datum:
            self.write_data(writers_schema.items, item, encoder)
    encoder.write_long(0)
