496 ^ self positionError |
496 ^ self positionError |
497 ! ! |
497 ! ! |
498 |
498 |
499 !NonPositionableExternalStream methodsFor:'reading'! |
499 !NonPositionableExternalStream methodsFor:'reading'! |
500 |
500 |
501 readWait |
501 next |
|
502 "return the next element, if available. |
|
503 If nothing is available, this does never raise a read-beyond end signal. |
|
504 Instead, nil is returned immediately. |
|
505 |
|
506 Redefined, to wait on pipes and sockets" |
|
507 |
|
508 self readWaitWithTimeoutMs:nil. |
|
509 ^ super next |
|
510 ! |
|
511 |
|
512 nextLine |
|
513 "Redefined, to wait on pipes and sockets" |
|
514 |
|
515 self readWaitWithTimeoutMs:nil. |
|
516 ^ super nextLine |
|
517 ! |
|
518 |
|
519 nextOrNil |
|
520 "like #next, this returns the next element, if available. |
|
521 If nothing is available, this does never raise a read-beyond end signal. |
|
522 Instead, nil is returned immediately. |
|
523 |
|
524 Redefined, to wait on pipes and sockets" |
|
525 |
|
526 self atEnd ifTrue:[^ nil]. |
|
527 ^ super nextOrNil |
|
528 ! |
|
529 |
|
530 peek |
|
531 "Redefined, to wait on pipes and sockets" |
|
532 |
|
533 self readWaitWithTimeoutMs:nil. |
|
534 ^ super peek |
|
535 ! |
|
536 |
|
537 peekOrNil |
|
538 "like #peek, this returns the next element, if available. |
|
539 If nothing is available, this does never raise a read-beyond end signal. |
|
540 Instead, nil is returned immediately. |
|
541 |
|
542 Redefined, to wait on pipes and sockets" |
|
543 |
|
544 self atEnd ifTrue:[^ nil]. |
|
545 ^ self peek |
|
546 ! |
|
547 |
|
548 readWaitWithTimeoutMs:millisecondsOrNil |
502 "cannot do a readWait (which means possible suspend), |
549 "cannot do a readWait (which means possible suspend), |
503 if the processor is not yet initialized; i.e. if a read is attempted |
550 if the processor is not yet initialized; i.e. if a read is attempted |
504 during early startup. |
551 during early startup. |
505 This may happen, for example, if a MiniDebugger is entered, before |
552 This may happen, for example, if a MiniDebugger is entered, before |
506 process scheduling has been setup. |
553 process scheduling has been setup. |
507 In this case, all I/O operations here will be blocking." |
554 In this case, all I/O operations here will be blocking." |
508 |
555 |
509 Smalltalk isInitialized ifFalse:[ ^ false ]. |
556 Smalltalk isInitialized ifFalse:[ ^ false ]. |
510 ^ super readWait |
557 ^ super readWaitWithTimeoutMs:millisecondsOrNil |
511 ! |
|
512 |
|
513 next |
|
514 "return the next element, if available. |
|
515 If nothing is available, this does never raise a read-beyond end signal. |
|
516 Instead, nil is returned immediately. |
|
517 |
|
518 Redefined, to wait on pipes and sockets" |
|
519 |
|
520 self readWait. |
|
521 ^ super next |
|
522 ! |
|
523 |
|
524 nextLine |
|
525 "Redefined, to wait on pipes and sockets" |
|
526 |
|
527 self readWait. |
|
528 ^ super nextLine |
|
529 ! |
|
530 |
|
531 nextOrNil |
|
532 "like #next, this returns the next element, if available. |
|
533 If nothing is available, this does never raise a read-beyond end signal. |
|
534 Instead, nil is returned immediately. |
|
535 |
|
536 Redefined, to wait on pipes and sockets" |
|
537 |
|
538 self atEnd ifTrue:[^ nil]. |
|
539 ^ super nextOrNil |
|
540 ! |
|
541 |
|
542 peek |
|
543 "Redefined, to wait on pipes and sockets" |
|
544 |
|
545 self readWait. |
|
546 ^ super peek |
|
547 ! |
|
548 |
|
549 peekOrNil |
|
550 "like #peek, this returns the next element, if available. |
|
551 If nothing is available, this does never raise a read-beyond end signal. |
|
552 Instead, nil is returned immediately. |
|
553 |
|
554 Redefined, to wait on pipes and sockets" |
|
555 |
|
556 self atEnd ifTrue:[^ nil]. |
|
557 ^ self peek |
|
558 ! ! |
558 ! ! |
559 |
559 |
560 !NonPositionableExternalStream methodsFor:'writing'! |
560 !NonPositionableExternalStream methodsFor:'writing'! |
561 |
561 |
562 nextPutAll:aCollection |
562 nextPutAll:aCollection |