Factor out BzDataWriter.