added C style vector read and write