Allocating a new buffer for each read will have visible performance consequences (this code is key to most benchmarks against shapefile data), please undo this change