implement BA::Array::writeHDF5, needs refactoring