什么时候使用Ruby的StringIO而不是仅仅使用String是合适的?
I think I understand the fundamental difference between them as highlighted by "What is ruby's StringIO class really?", that StringIO enables one to read and write from/to a String in a stream-oriented manner. But what does this mean practically?
当仅仅使用String并不能真正解决问题时,使用StringIO的一个很好的实用例子是什么?