我是Grails的新手.我可以使用"hasOne"或"hasMany"而不使用"belongsTo"到另一个域类吗?
提前致谢.
我必须读取一个大文本文件并使用C#逐行解析它.StreamReader对于小型文件,它可以很容易地完成,但是在处理大文件时它会出现内存异常.如何使其适应大文件?
以下代码捕获OutOfMemoryException:
using (StreamReader reader = new StreamReader(FileNameWithPath))
{
while ((line = reader.ReadLine()) != null)
{
// Do something here...
}
}
Run Code Online (Sandbox Code Playgroud)