01: /*
02: * ReadInputStreamChannel.java
03: *
04: */
05: package tcl.lang;
06:
07: import java.io.*;
08:
09: /**
10: * The ReadInputStreamChannel class is a bridge between existing Java
11: * InputStream objects and Tcl channels.
12: **/
13:
14: public class ReadInputStreamChannel extends Channel {
15:
16: InputStream inStream;
17:
18: /**
19: * Constructor - creates a new ReadInputStreamChannel object that
20: * will read from the passed in InputStream.
21: **/
22:
23: public ReadInputStreamChannel(Interp interp, InputStream in_stream) {
24: this .mode = TclIO.RDONLY;
25: this .inStream = in_stream;
26: }
27:
28: String getChanType() {
29: return "ReadInputStream";
30: }
31:
32: protected InputStream getInputStream() throws IOException {
33: return inStream;
34: }
35:
36: protected OutputStream getOutputStream() throws IOException {
37: throw new RuntimeException("should never be called");
38: }
39: }
|