Interaction with StringIO that works on both MRI and JRuby