added tests for bufferedWrite