Added test to validate the data read and written to the buffer.