# I/O implementations for testing