Refactor Write InputStream

WAY-48