can read template from InputStream.