Remove redundant code.
Added close methods to DataReader and DataWriter.