InputStream Class
Objects of this class represent a stream that can be used to receive data from a peer. You can't create objects of this class directly. You will receive an instance via the receivedStream event.
Methods
close
()
Closes the stream.
isInputStream
()
Returns true
.
isOutputStream
()
Returns false
.
read
(
Number
-
params
Reads up to a given number of from the stream.
The streamReadCompleted event is fired when the operation is completed.
Parameters:
-
params
Object-
[maxLength]
Number optionalThe maximum number of bytes to read. The default is 1024 bytes.
-
Returns:
Number:
The number of bytes actually read, or -1 if an error occurs.
Properties
hasData
Boolean
read-only
Returns a Boolean value that indicates whether the stream has bytes available to read.