a reader write by scala