lgp to istream