added an IOMapper class for passing IO resources to readers and writers