str = EncodingUtils.setStrBuf(runtime, str, ilen);
ByteList strByteList = ((RubyString) str).getByteList();
n = OpenFile.readInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), ilen);
if (n == -1) {
throw runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
}
} finally {
if (locked) fptr.unlock();
}