Changed InputStream parsing method