corrected some warnings
completed buffered file stream with test case