Interface nsIAsyncInputStreamLengthType

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • If the stream is non-blocking, nsIInputStreamLength::length() can return NS_BASE_STREAM_WOULD_BLOCK. The caller must then wait for the stream to know its length.

    If the stream implements nsIAsyncInputStreamLength, then the caller can use this interface to request an asynchronous notification when the stream's length becomes known (via the AsyncLengthWait method). If the length is already known, the aCallback will be still called asynchronously.

    If the stream has already been read (read()/readSegments()/close()/seek() methods has been called), length() returns NS_ERROR_NOT_AVAILABLE.

    Parameters

    • aCallback: nsIInputStreamLengthCallback

      This object is notified when the length becomes known. This parameter may be null to clear an existing callback.

    • aEventTarget: nsIEventTarget

      Specify that the notification must be delivered to a specific event target.

    Returns void

Generated using TypeDoc