Back: TCP.RawSocketImpl class-parameters Up: TCP package Forward: TCP.ReadBuffer class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

6.12 TCP.ReadBuffer

Defined in namespace TCP
Superclass: ReadStream
Category: Examples-Useful tools

I'm a ReadStream that, when the end of the stream is reached, evaluates an user defined block to try to get some more data.

6.12.1 TCP.ReadBuffer class: instance creation  (class)
6.12.2 TCP.ReadBuffer: buffer handling  (instance)


6.12.1 TCP.ReadBuffer class: instance creation

on: aCollection
Answer a Stream that uses aCollection as a buffer. You should ensure that the fillBlock is set before the first operation, because the buffer will report that the data has ended until you set the fillBlock.


6.12.2 TCP.ReadBuffer: buffer handling

atEnd
Answer whether the data stream has ended.

bufferContents
Answer the data that is in the buffer, and empty it.

fill
Fill the buffer with more data if it is empty, and answer true if the fill block was able to read more data.

fillBlock: block
Set the block that fills the buffer. It receives a collection and the number of bytes to fill in it, and must return the number of bytes actually read

isEmpty
Answer whether the next input operation will force a buffer fill

isFull
Answer whether the buffer has been just filled

notEmpty
Check whether the next input operation will force a buffer fill and answer true if it will not.

pastEnd
Try to fill the buffer if the data stream has ended.



Back: TCP.ReadBuffer class-instance creation Up: TCP.ReadBuffer Forward: TCP.ServerSocket   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html