tcl.lang
Class ReadInputStreamChannel

java.lang.Object
  extended by tcl.lang.ReadInputStreamChannel

public class ReadInputStreamChannel
extends java.lang.Object

The ReadInputStreamChannel class is a bridge between existing Java InputStream objects and Tcl channels.


Field Summary
protected  boolean blocking
          Set to false when channel is in non-blocking mode.
protected  int buffering
          Buffering (full,line, or none)
protected  int bufferSize
          Buffer size, in bytes, allocated for channel to store input or output
protected  int bytesPerChar
           
protected  java.lang.String encoding
          Name of Java encoding for this Channel.
protected  tcl.lang.TclInputStream input
          Tcl input and output objecs.
protected  char inputEofChar
          If nonzero, use this as a signal of EOF on input.
protected  int inputTranslation
          Translation mode for end-of-line character
protected  int mode
          The read, write, append and create flags are set here.
protected  tcl.lang.TclOutputStream output
           
protected  char outputEofChar
          If nonzero, append this to a writeable channel on close.
protected  int outputTranslation
           
protected  int refCount
          How many interpreters hold references to this IO channel?
 
Constructor Summary
ReadInputStreamChannel(Interp interp, java.io.InputStream in_stream)
          Constructor - creates a new ReadInputStreamChannel object that will read from the passed in InputStream.
 
Method Summary
protected  void checkRead(Interp interp)
           
protected  void checkWrite(Interp interp)
           
protected  java.io.InputStream getInputStream()
          This method should be overridden in the subclass to provide a channel specific InputStream object.
protected  java.io.OutputStream getOutputStream()
          This method should be overridden in the subclass to provide a channel specific OutputStream object.
protected  void initInput()
          Setup the TclInputStream on the first call to read
protected  void initOutput()
          Setup the TclOutputStream on the first call to write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mode

protected int mode
The read, write, append and create flags are set here. The variables used to set the flags are found in the class TclIO.


refCount

protected int refCount
How many interpreters hold references to this IO channel?


input

protected tcl.lang.TclInputStream input
Tcl input and output objecs. These are like a mix between a Java Stream and a Reader.


output

protected tcl.lang.TclOutputStream output

blocking

protected boolean blocking
Set to false when channel is in non-blocking mode.


buffering

protected int buffering
Buffering (full,line, or none)


bufferSize

protected int bufferSize
Buffer size, in bytes, allocated for channel to store input or output


encoding

protected java.lang.String encoding
Name of Java encoding for this Channel. A null value means use no encoding (binary).


bytesPerChar

protected int bytesPerChar

inputTranslation

protected int inputTranslation
Translation mode for end-of-line character


outputTranslation

protected int outputTranslation

inputEofChar

protected char inputEofChar
If nonzero, use this as a signal of EOF on input.


outputEofChar

protected char outputEofChar
If nonzero, append this to a writeable channel on close.

Constructor Detail

ReadInputStreamChannel

public ReadInputStreamChannel(Interp interp,
                              java.io.InputStream in_stream)
Constructor - creates a new ReadInputStreamChannel object that will read from the passed in InputStream.

Method Detail

getInputStream

protected java.io.InputStream getInputStream()
                                      throws java.io.IOException
This method should be overridden in the subclass to provide a channel specific InputStream object.

Throws:
java.io.IOException

getOutputStream

protected java.io.OutputStream getOutputStream()
                                        throws java.io.IOException
This method should be overridden in the subclass to provide a channel specific OutputStream object.

Throws:
java.io.IOException

initInput

protected void initInput()
                  throws java.io.IOException
Setup the TclInputStream on the first call to read

Throws:
java.io.IOException

initOutput

protected void initOutput()
                   throws java.io.IOException
Setup the TclOutputStream on the first call to write

Throws:
java.io.IOException

checkRead

protected void checkRead(Interp interp)
                  throws TclException
Throws:
TclException

checkWrite

protected void checkWrite(Interp interp)
                   throws TclException
Throws:
TclException