| java.lang.Object tcl.lang.Channel tcl.lang.FileChannel
FileChannel | class FileChannel extends Channel (Code) | | Subclass of the abstract class Channel. It implements all of the
methods to perform read, write, open, close, etc on a file.
|
Method Summary | |
void | close() Close the file. | String | getChanType() | protected InputStream | getInputStream() | protected OutputStream | getOutputStream() | String | open(Interp interp, String fileName, int modeFlags) Open a file with the read/write permissions determined by modeFlags.
This method must be called before any other methods will function
properly.
Parameters: interp - currrent interpreter. Parameters: fileName - the absolute path or name of file in the current directory to open Parameters: modeFlags - modes used to open a file for reading, writing, etc the channelId of the file. exception: TclException - is thrown when the modeFlags try to opena file it does not have permission for or if thefile dosent exist and CREAT wasnt specified. exception: IOException - is thrown when an IO error occurs that was notcorrectly tested for. | void | seek(Interp interp, long offset, int inmode) Move the file pointer internal to the RandomAccessFile object. | long | tell() Tcl_Tell -> tell
Return the current offset of the file pointer in number of bytes from
the beginning of the file. |
close | void close() throws IOException(Code) | | Close the file. The file MUST be open or a TclRuntimeError
is thrown.
|
open | String open(Interp interp, String fileName, int modeFlags) throws IOException, TclException(Code) | | Open a file with the read/write permissions determined by modeFlags.
This method must be called before any other methods will function
properly.
Parameters: interp - currrent interpreter. Parameters: fileName - the absolute path or name of file in the current directory to open Parameters: modeFlags - modes used to open a file for reading, writing, etc the channelId of the file. exception: TclException - is thrown when the modeFlags try to opena file it does not have permission for or if thefile dosent exist and CREAT wasnt specified. 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 inmode) throws IOException, TclException(Code) | | Move the file pointer internal to the RandomAccessFile object.
The file MUST be open or a TclRuntimeError is thrown.
Parameters: offset - The number of bytes to move the file pointer. Parameters: inmode - to begin incrementing the file pointer; beginning,current, or end of the file. |
tell | long tell() throws IOException(Code) | | Tcl_Tell -> tell
Return the current offset of the file pointer in number of bytes from
the beginning of the file. The file MUST be open or a TclRuntimeError
is thrown.
The current value of the file pointer. |
Methods inherited from tcl.lang.Channel | protected void checkRead(Interp interp) throws TclException(Code)(Java Doc) protected void checkWrite(Interp interp) throws TclException(Code)(Java Doc) void close() throws IOException(Code)(Java Doc) final boolean eof()(Code)(Java Doc) void flush(Interp interp) throws IOException, TclException(Code)(Java Doc) boolean getBlocking()(Code)(Java Doc) int getBufferSize()(Code)(Java Doc) int getBuffering()(Code)(Java Doc) String getChanName()(Code)(Java Doc) abstract String getChanType()(Code)(Java Doc) String getEncoding()(Code)(Java Doc) char getInputEofChar()(Code)(Java Doc) abstract protected InputStream getInputStream() throws IOException(Code)(Java Doc) int getInputTranslation()(Code)(Java Doc) int getNumBufferedInputBytes()(Code)(Java Doc) int getNumBufferedOutputBytes()(Code)(Java Doc) char getOutputEofChar()(Code)(Java Doc) abstract protected OutputStream getOutputStream() throws IOException(Code)(Java Doc) int getOutputTranslation()(Code)(Java Doc) int getRefCount()(Code)(Java Doc) protected void initInput() throws IOException(Code)(Java Doc) protected void initOutput() throws IOException(Code)(Java Doc) boolean inputSawCR()(Code)(Java Doc) boolean isBgFlushScheduled()(Code)(Java Doc) boolean isBlocked(Interp interp) throws TclException(Code)(Java Doc) boolean isReadOnly()(Code)(Java Doc) boolean isReadWrite()(Code)(Java Doc) boolean isWriteOnly()(Code)(Java Doc) int read(Interp interp, TclObject tobj, int readType, int numBytes) throws IOException, TclException(Code)(Java Doc) void seek(Interp interp, long offset, int mode) throws IOException, TclException(Code)(Java Doc) void setBlocking(boolean inBlocking)(Code)(Java Doc) void setBufferSize(int size)(Code)(Java Doc) void setBuffering(int inBuffering)(Code)(Java Doc) void setChanName(String chan)(Code)(Java Doc) void setEncoding(String inEncoding)(Code)(Java Doc) void setInputEofChar(char inEof)(Code)(Java Doc) void setInputTranslation(int translation)(Code)(Java Doc) void setOutputEofChar(char outEof)(Code)(Java Doc) void setOutputTranslation(int translation)(Code)(Java Doc) long tell() throws IOException(Code)(Java Doc) void write(Interp interp, TclObject outData) throws IOException, TclException(Code)(Java Doc) void write(Interp interp, String outStr) throws IOException, TclException(Code)(Java Doc)
|
|
|