クラス概説 †
読み込み専用ストリームです.
クラスメソッド †
instance creation †
- on: aCollection from: firstIndex to: lastIndex
- aCollectionのfirstIndexからlastIndexまでの要素をストリームの入力としてインスタンスを作成します.
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next.
--> $0
インスタンスメソッド †
accessing †
- ascii
- 非実装
- binary
- 非実装
- next
- ストリームから次の内容を読み取る.
- next: anInteger
- anInteger個読み取った内容を返す.
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next:5.
--> '01234'
- next: n into: aCollection startingAt: startIndex
- aCollectionの内容をstartIndex番目からn個読み取った内容で置き換えます.
| in in2 s |
in := '0123456789 abcdefg'.
in2:= '#$%&_'.
s := ReadStream on:in from:1 to:in size.
s next:5.
s next:3 into:in2 startingAt:2
--> '#567_'
- nextPut: anObject
- 未実装
- readStream3.7
- 自身(self)を返します.
- size
- 読み込み可能サイズを返す.
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next:5.
s size.
--> 18
- untilEnd: aBlock displayingProgress: aString
- ストリームをブロックaBlockで読み取り,プログレスバーをタイトルaStringで表示します.
- upTo:anObject
- 現在の読み取り位置からanObjectまで読み取ります.anObjectがない場合は最後まで読み取ります.
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next:5.
s upTo:$e.
--> '56789 abcd'
"anObjectにないものを指定"
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next:5.
s upTo:$x.
--> '56789 abcdefg'
- upToEnd
- 現在の読み取り位置から最後まで読み取ります.
| in s |
in := '0123456789 abcdefg'.
s := ReadStream on:in from:1 to:in size.
s next:5.
s upToEnd
--> '56789 abcdefg'
file stream compatibility †
- localName
- 'ReadStream'を返します.
- openReadOnly
- 非実装
- readOnly
- 非実装
コメント・つっこみ †
|