Squeak Class Documentation category index | class index  
 
RWBinaryOrTextStream
  category: Collections-Streams
  superclass: ReadWriteStream
  subclasses: RemoteFileStream SwikiPseudoFileStream

A simulation of a FileStream, but living totally in memory. Hold the contents of a file or web page from the network. Can then fileIn like a normal FileStream.

Need to be able to switch between binary and text, as a FileStream does, without recopying the whole collection. Convert to binary upon input and output. Always keep as text internally.

instance methods
  as yet unclassified
  asBinaryOrTextStream
ascii
binary
contents
contentsOfEntireFile
isBinary
next
next:
next:into:startingAt:
nextPut:
padToEndWith:
reset
setFileTypeToObject
text
upToEnd

class methods
  no messages
 

instance methods
  as yet unclassified top  
 

asBinaryOrTextStream

Convert to a stream that can switch between bytes and characters


 

ascii


 

binary


 

contents

Answer with a copy of my collection from 1 to readLimit.


 

contentsOfEntireFile

For compatibility with file streams.


 

isBinary

Return true if the receiver is a binary byte stream


 

next

Primitive. Return the next object in the Stream represented by the
receiver. Fail if the collection of this stream is not an Array or a String.
Fail if the stream is positioned at its end, or if the position is out of
bounds in the collection. Optional. See Object documentation
whatIsAPrimitive.


 

next:

Answer the next anInteger elements of my collection. Must override to get class right.


 

next:into:startingAt:

Read n objects into the given collection.
Return aCollection or a partial copy if less than n elements have been read.


 

nextPut:

Primitive. Insert the argument at the next position in the Stream
represented by the receiver. Fail if the collection of this stream is not an
Array or a String. Fail if the stream is positioned at its end, or if the
position is out of bounds in the collection. Fail if the argument is not
of the right type for the collection. Optional. See Object documentation
whatIsAPrimitive.


 

padToEndWith:

We don't have pages, so we are at the end, and don't need to pad.


 

reset

Set the receiver's position to the beginning of the sequence of objects.


 

setFileTypeToObject

do nothing. We don't have a file type


 

text


 

upToEnd

Must override to get class right.


class methods
  no messages top