Logical Labs Multipeer Module

API Docs for: 1.0.0
Show:

InputStream Class

Module: Readme

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.

Item Index

Properties

Methods

close

()

Available since 1.0.0

Closes the stream.

isInputStream

()

Available since 1.0.0

Returns true.

isOutputStream

()

Available since 1.0.0

Returns false.

read

(
  • params
)
Number

Available since 1.0.0

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 optional

      The 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

Available since 1.0.0

Returns a Boolean value that indicates whether the stream has bytes available to read.