| java.lang.Object tcl.lang.Channel
All known Subclasses: tcl.lang.ReadInputStreamChannel, tcl.lang.FileChannel, tcl.lang.SocketChannel, tcl.lang.StdChannel, tcl.lang.ServerSocketChannel,
Channel | abstract class Channel (Code) | | The Channel class provides functionality that will
be needed for any type of Tcl channel. It performs
generic reads, writes, without specifying how a
given channel is actually created. Each new channel
type will need to extend the abstract Channel class
and override any methods it needs to provide a
specific implementation for.
|
blocking | protected boolean blocking(Code) | | Set to false when channel is in non-blocking mode.
|
bufferSize | protected int bufferSize(Code) | | Buffer size, in bytes, allocated for channel to store input or output
|
buffering | protected int buffering(Code) | | Buffering (full,line, or none)
|
bytesPerChar | protected int bytesPerChar(Code) | | |
encoding | protected String encoding(Code) | | Name of Java encoding for this Channel.
A null value means use no encoding (binary).
|
input | protected TclInputStream input(Code) | | Tcl input and output objecs. These are like a mix between
a Java Stream and a Reader.
|
inputEofChar | protected char inputEofChar(Code) | | If nonzero, use this as a signal of EOF on input.
|
inputTranslation | protected int inputTranslation(Code) | | Translation mode for end-of-line character
|
mode | protected int mode(Code) | | The read, write, append and create flags are set here. The
variables used to set the flags are found in the class TclIO.
|
outputEofChar | protected char outputEofChar(Code) | | If nonzero, append this to a writeable channel on close.
|
outputTranslation | protected int outputTranslation(Code) | | |
refCount | protected int refCount(Code) | | How many interpreters hold references to this IO channel?
|
close | void close() throws IOException(Code) | | Close the Channel. The channel is only closed, it is
the responsibility of the "closer" to remove the channel from
the channel table.
|
eof | final boolean eof()(Code) | | Returns true if the last read reached the EOF.
|
getBlocking | boolean getBlocking()(Code) | | Query blocking mode.
|
getBufferSize | int getBufferSize()(Code) | | Query buffer size
|
getBuffering | int getBuffering()(Code) | | Query buffering mode.
|
getChanName | String getChanName()(Code) | | Gets the chanName that is the key for the chanTable hashtable.
channelId |
getChanType | abstract String getChanType()(Code) | | Return a string that describes the channel type.
This is the equivilent of the Tcl_ChannelType->typeName field.
|
getEncoding | String getEncoding()(Code) | | Query encoding
Name of Channel's Java encoding (null if no encoding) |
getInputEofChar | char getInputEofChar()(Code) | | Query input eof character
|
getInputStream | abstract protected InputStream getInputStream() throws IOException(Code) | | This method should be overridden in the subclass to provide
a channel specific InputStream object.
|
getInputTranslation | int getInputTranslation()(Code) | | Query input translation
|
getNumBufferedInputBytes | int getNumBufferedInputBytes()(Code) | | |
getNumBufferedOutputBytes | int getNumBufferedOutputBytes()(Code) | | |
getOutputEofChar | char getOutputEofChar()(Code) | | Query output eof character
|
getOutputStream | abstract protected OutputStream getOutputStream() throws IOException(Code) | | This method should be overridden in the subclass to provide
a channel specific OutputStream object.
|
getOutputTranslation | int getOutputTranslation()(Code) | | Query output translation
|
getRefCount | int getRefCount()(Code) | | Return number of references to this Channel.
|
initInput | protected void initInput() throws IOException(Code) | | Setup the TclInputStream on the first call to read
|
initOutput | protected void initOutput() throws IOException(Code) | | Setup the TclOutputStream on the first call to write
|
inputSawCR | boolean inputSawCR()(Code) | | Channel is in CRLF eol input translation mode and the last
byte seen was a CR.
|
isBgFlushScheduled | boolean isBgFlushScheduled()(Code) | | Returns true if a background flush is waiting to happen.
|
isBlocked | boolean isBlocked(Interp interp) throws TclException(Code) | | Tcl_InputBlocked -> isBlocked
Returns true if input is blocked on this channel, false otherwise.
|
isReadOnly | boolean isReadOnly()(Code) | | |
isReadWrite | boolean isReadWrite()(Code) | | |
isWriteOnly | boolean isWriteOnly()(Code) | | |
read | int read(Interp interp, TclObject tobj, int readType, int numBytes) throws IOException, TclException(Code) | | Tcl_ReadChars -> read
Read data from the Channel into the given TclObject.
Parameters: interp - is used for TclExceptions. Parameters: tobj - the object data will be added to. Parameters: readType - specifies if the read should read the entirebuffer (TclIO.READ_ALL), the next line(TclIO.READ_LINE), of a specified numberof bytes (TclIO.READ_N_BYTES). Parameters: numBytes - the number of bytes/chars to read. Used onlywhen the readType is TclIO.READ_N_BYTES. the number of bytes read.Returns -1 on EOF or on error. exception: TclException - is thrown if read occurs on WRONLY channel. exception: IOException - is thrown when an IO error occurs that was notcorrectly tested for. Most cases should be caught. |
seek | void seek(Interp interp, long offset, int mode) throws IOException, TclException(Code) | | Move the current file pointer. If seek is not supported on the
given channel then -1 will be returned. A subclass should
override this method if it supports the seek operation.
Parameters: interp - currrent interpreter. Parameters: offset - The number of bytes to move the file pointer. Parameters: mode - where to begin incrementing the file pointer; beginning,current, end. |
setBlocking | void setBlocking(boolean inBlocking)(Code) | | Set blocking mode.
Parameters: blocking - new blocking mode |
setBufferSize | void setBufferSize(int size)(Code) | | Tcl_SetChannelBufferSize -> setBufferSize
Parameters: size - new buffer size |
setBuffering | void setBuffering(int inBuffering)(Code) | | Set buffering mode
Parameters: buffering - One of TclIO.BUFF_FULL, TclIO.BUFF_LINE,or TclIO.BUFF_NONE |
setChanName | void setChanName(String chan)(Code) | | Sets the chanName that is the key for the chanTable hashtable.
Parameters: chan - the unique channelId |
setEncoding | void setEncoding(String inEncoding)(Code) | | Set new Java encoding
|
setInputEofChar | void setInputEofChar(char inEof)(Code) | | Set new input eof character
|
setInputTranslation | void setInputTranslation(int translation)(Code) | | Set new input translation
|
setOutputEofChar | void setOutputEofChar(char outEof)(Code) | | Set new output eof character
|
setOutputTranslation | void setOutputTranslation(int translation)(Code) | | Set new output translation
|
tell | long tell() throws IOException(Code) | | Return the current file pointer. If tell is not supported on the
given channel then -1 will be returned. A subclass should override
this method if it supports the tell operation.
|
write | void write(Interp interp, TclObject outData) throws IOException, TclException(Code) | | Tcl_WriteObj -> write
Write data to the Channel
Parameters: interp - is used for TclExceptions. Parameters: outData - the TclObject that holds the data to write. |
write | void write(Interp interp, String outStr) throws IOException, TclException(Code) | | Tcl_WriteChars -> write
Write string data to the Channel.
Parameters: interp - is used for TclExceptions. Parameters: outStr - the String object to write. |
|
|