fptr.READ_CHECK(context);
// #if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
// previous_mode = set_binary_mode_with_seek_cur(fptr);
// #endif
n = fptr.fread(context, str, 0, len);
} finally {
if (locked) fptr.unlock();
}
((RubyString)str).setReadLength(n);