Java Doc for TclInputStream.java in  » Scripting » jacl » tcl » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jacl » tcl.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   tcl.lang.TclInputStream

TclInputStream
class TclInputStream (Code)


Field Summary
protected  booleanblocked
    
protected  booleanblocking
    
protected  intbufSize
    
protected  intbuffering
    
protected  CharsetDecodercsd
     Charset decoder object.
protected  Stringencoding
     Name of Java encoding for this Channel.
 booleanencodingEnd
    
 booleanencodingStart
     Flags used to track encoding states. The encodingState member of called inputEncodingState in the C ChannelState type.
 ChannelBufferinQueueHead
     First and last buffers in the input queue.
 ChannelBufferinQueueTail
    
protected  booleanneedMoreData
    
protected  booleanneedNL
    
static  IntegeroneInteger
    
 ChannelBuffersaveInBuf
    
protected  booleansawCR
    
static  IntegerthreeInteger
    
protected  inttranslation
    
static  IntegertwoInteger
    

Constructor Summary
 TclInputStream(InputStream inInput)
     Constructor for Tcl input stream class.

Method Summary
 voidclose()
    
 voidcommonGetsCleanup()
     CommonGetsCleanup -> commonGetsCleanup Helper function used by getsObj to restore the channel after a "gets" operation.
static  intdecodedNumBytes(ArrayList charToBytes, int start, int end)
    
 intdoReadChars(TclObject obj, int toRead)
     DoReadChars -> doReadChars Reads from the channel until the requested number of characters have been seen, EOF is seen, or the channel would block.
 booleaneof()
    
 intexternalToUnicode(byte[] src, int srcOff, int srcLen, char[] dst, int dstOff, int dstLen, IntPtr srcReadPtr, IntPtr dstWrotePtr, IntPtr dstCharsPtr, ArrayList charToBytes)
     Tcl_ExternalToUtf -> externalToUnicode Convert a source buffer from the specified encoding into Unicode. FIXME: Add doc for return values src, Source bytes in specified encoding.
 intfilterBytes(GetsState gs)
     FilterInputBytes -> filterBytes Helper function for getsObj.
 intgetNumBufferedBytes()
     Tcl_InputBuffered -> getNumBufferedBytes Return the number of bytes that are current buffered.
 intgetsObj(TclObject tobj)
     Tcl_GetsObj -> getsObj Accumulate input from the input channel until end-of-line or end-of-file has been seen.
 booleanisBlocked()
    
 voidpeekAhead(GetsState gs)
     PeekAhead -> peekAhead Helper function used by getsObj.
 intreadBytes(TclObject obj, int bytesToRead, IntPtr offsetPtr)
     ReadBytes -> readBytes Reads from the channel until the requested number of bytes have been seen, EOF is seen, or the channel would block.
 intreadChars(TclObject tobj, int charsToRead)
     ReadChars -> readChars Reads from the channel until the requested number of characters have been seen, EOF is seen, or the channel would block.
 booleansawCR()
    
 voidseekReset()
     seekReset Helper method used to reset state info when doing a seek.
 voidsetBlocking(boolean inBlocking)
    
 voidsetBufferSize(int inBufSize)
    
 voidsetBuffering(int inBuffering)
    
 voidsetEncoding(String inEncoding)
    
 voidsetEofChar(char inEofChar)
    
 voidsetTranslation(int inTranslation)
    
 inttranslateEOL(Object dstArray, int dstStart, Object srcArray, int srcStart, IntPtr dstLenPtr, IntPtr srcLenPtr)
     TranslateInputEOL -> translateEOL Perform input EOL and EOF translation on the source buffer, leaving the translated result in the destination buffer. Results: The return value is 1 if the EOF character was found when copying bytes to the destination buffer, 0 otherwise.
 voidupdateInterest()
     UpdateInterest -> updateInterest Arrange for the notifier to call us back at appropriate times based on the current state of the channel.

Field Detail
blocked
protected boolean blocked(Code)
Blocked



blocking
protected boolean blocking(Code)
Blocking



bufSize
protected int bufSize(Code)
Buffer size in bytes



buffering
protected int buffering(Code)
Buffering



csd
protected CharsetDecoder csd(Code)
Charset decoder object. A null value means that no conversions have been done yet.



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



encodingEnd
boolean encodingEnd(Code)



encodingStart
boolean encodingStart(Code)
Flags used to track encoding states. The encodingState member of called inputEncodingState in the C ChannelState type. The encodingStart and encodingEnd members combined are called inputEncodingFlags and have the bit values TCL_ENCODING_END and TCL_ENCODING_START.



inQueueHead
ChannelBuffer inQueueHead(Code)
First and last buffers in the input queue.



inQueueTail
ChannelBuffer inQueueTail(Code)



needMoreData
protected boolean needMoreData(Code)



needNL
protected boolean needNL(Code)
Used to track EOL state



oneInteger
static Integer oneInteger(Code)



saveInBuf
ChannelBuffer saveInBuf(Code)



sawCR
protected boolean sawCR(Code)



threeInteger
static Integer threeInteger(Code)



translation
protected int translation(Code)
Translation mode for end-of-line character



twoInteger
static Integer twoInteger(Code)




Constructor Detail
TclInputStream
TclInputStream(InputStream inInput)(Code)
Constructor for Tcl input stream class. We require a byte stream source at init time, the stram can't be changed after the TclInputStream is created.




Method Detail
close
void close() throws IOException(Code)



commonGetsCleanup
void commonGetsCleanup()(Code)
CommonGetsCleanup -> commonGetsCleanup Helper function used by getsObj to restore the channel after a "gets" operation.



decodedNumBytes
static int decodedNumBytes(ArrayList charToBytes, int start, int end)(Code)



doReadChars
int doReadChars(TclObject obj, int toRead) throws IOException(Code)
DoReadChars -> doReadChars Reads from the channel until the requested number of characters have been seen, EOF is seen, or the channel would block. EOL and EOF translation is done. If reading binary data, the raw bytes are wrapped in a Tcl byte array object. Otherwise, the raw bytes are converted to characters using the channel's current encoding and stored in a Tcl string object.
Parameters:
  obj - Input data is stored in this object.
Parameters:
  toRead - Maximum number of characters to store,or -1 to read all available data (up to EOFor when channel blocks).



eof
boolean eof()(Code)



externalToUnicode
int externalToUnicode(byte[] src, int srcOff, int srcLen, char[] dst, int dstOff, int dstLen, IntPtr srcReadPtr, IntPtr dstWrotePtr, IntPtr dstCharsPtr, ArrayList charToBytes)(Code)
Tcl_ExternalToUtf -> externalToUnicode Convert a source buffer from the specified encoding into Unicode. FIXME: Add doc for return values src, Source bytes in specified encoding. srcOff, First index in src input array. srcLen, Number of bytes in src buffer. dst, Array to store unicode characters in. dstOff, First available index in dst array. dstLen, Length of dst array. srcReadPtr, Filled with the number of bytes fromthe source string that were converted.This may be less than the original sourcelength if there was a problem convertingsome source characters. dstWrotePtr, Filled with the number of chars that werestored in the output buffer as a result ofthe conversion dstCharsPtr, Filled with the number of characters thatcorrespond to the bytes stored in theoutput buffer. charToBytes, Contains int's that are used to map convertedbytes to chars. Can be null.



filterBytes
int filterBytes(GetsState gs)(Code)
FilterInputBytes -> filterBytes Helper function for getsObj. Appends Unicode characters onto the TclObject associated with the GetsState after converting them from raw bytes encoded in the Channel. The StringBuffer inside a TclObject is modified directly. Consumes available bytes from channel buffers. When channel buffers are exhausted, reads more bytes from channel device into a new channel buffer. It is the caller's responsibility to free the channel buffers that have been exhausted. The return value is -1 if there was an error reading from the channel, 0 otherwise. Status object keeps track of how much data from channel buffers has been consumed and where characters should be stored.



getNumBufferedBytes
int getNumBufferedBytes()(Code)
Tcl_InputBuffered -> getNumBufferedBytes Return the number of bytes that are current buffered.



getsObj
int getsObj(TclObject tobj)(Code)
Tcl_GetsObj -> getsObj Accumulate input from the input channel until end-of-line or end-of-file has been seen. Bytes read from the input channel are converted to Unicode using the encoding specified by the channel. Returns the number of characters accumulated in the object or -1 if error, blocked, or EOF. If -1, use Tcl_GetErrno() to retrieve the POSIX error code for the error or condition that occurred. Will consume input from the channel. On reading EOF, leave channel at EOF char. On reading EOL, leave channel after EOL, but don't return EOL in dst buffer.



isBlocked
boolean isBlocked()(Code)



peekAhead
void peekAhead(GetsState gs)(Code)
PeekAhead -> peekAhead Helper function used by getsObj. Called when we've seen a \r at the end of the string and want to look ahead one character to see if it is a \n. Characters read from the channel are appended to gs.obj via the filterBytes method.



readBytes
int readBytes(TclObject obj, int bytesToRead, IntPtr offsetPtr)(Code)
ReadBytes -> readBytes Reads from the channel until the requested number of bytes have been seen, EOF is seen, or the channel would block. Bytes from the channel are stored in obj as a ByteArray object. EOL and EOF translation are done. 'bytesToRead' can safely be a very large number because space is only allocated to hold data read from the channel as needed. The return value is the number of bytes appended to the object. obj, the TclByteArrayObject we are operating on bytesToRead, Maximum number of bytes to store.Bytes are obtained from the firstbuffer in the queue -- even if this numberis larger than the number of bytes onlythe bytes from the first buffer are returned.
Parameters:
  offsetPtr - On input, contains how many bytes ofobj have been used to hold data. Onoutput, how many bytes are now being used.



readChars
int readChars(TclObject tobj, int charsToRead) throws IOException(Code)
ReadChars -> readChars Reads from the channel until the requested number of characters have been seen, EOF is seen, or the channel would block. Raw bytes from the channel are converted to characters and stored in obj. EOL and EOF translation is done. 'charsToRead' can safely be a very large number because space is only allocated to hold data read from the channel as needed. The return value is the number of characters appended to the object. obj, the TclByteArrayObject we are operating on charsToRead, Maximum number of chars to store.Chars are obtained from the firstbuffer in the queue -- even if this numberis larger than the number of chars onlythe chars from the first buffer are returned.



sawCR
boolean sawCR()(Code)



seekReset
void seekReset()(Code)
seekReset Helper method used to reset state info when doing a seek.



setBlocking
void setBlocking(boolean inBlocking)(Code)



setBufferSize
void setBufferSize(int inBufSize)(Code)



setBuffering
void setBuffering(int inBuffering)(Code)



setEncoding
void setEncoding(String inEncoding)(Code)



setEofChar
void setEofChar(char inEofChar)(Code)



setTranslation
void setTranslation(int inTranslation)(Code)



translateEOL
int translateEOL(Object dstArray, int dstStart, Object srcArray, int srcStart, IntPtr dstLenPtr, IntPtr srcLenPtr)(Code)
TranslateInputEOL -> translateEOL Perform input EOL and EOF translation on the source buffer, leaving the translated result in the destination buffer. Results: The return value is 1 if the EOF character was found when copying bytes to the destination buffer, 0 otherwise. dstArray, Output buffer to fill with translated bytes or chars. dstStart, First unused index in the dst output array. srcArray, Input buffer that holds the bytes or chars to translate srcStart, Index of first available byte in src array. dstLenPtr, On entry, the maximum length of outputbuffer in bytes or chars; must be <= srcLenPtr.i. Onexit, the number of bytes or chars actually used inoutput buffer. srcLenPtr, On entry, the length of source buffer.On exit, the number of bytes or chars read fromthe source buffer.



updateInterest
void updateInterest()(Code)
UpdateInterest -> updateInterest Arrange for the notifier to call us back at appropriate times based on the current state of the channel.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.