A very fast buffer writer with expandable memory to reduce memory use