public ScheminPort(Stream stream, PortType type) { this.Type = type; if (type == PortType.InputPort) { this.InputStream = new StreamReader(stream, Encoding.UTF8); } else { this.OutputStream = new StreamWriter(stream, Encoding.UTF8); } }