Interface nsIStreamConverterServiceType

The nsIStreamConverterService is a higher level stream converter factory responsible for locating and creating stream converters (nsIStreamConverter).

This service retrieves an interface that can convert data from a particular MIME type, to a particular MIME type. It is responsible for any intermediary conversion required in order to get from X to Z, assuming direct conversion is not possible.

Author

Jud Valeski

See

nsIStreamConverter

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

  • ASYNCHRONOUS VERSION Retrieves a nsIStreamListener that receives the original/raw data via its nsIStreamListener::OnDataAvailable() callback, then converts and pushes the data to aListener.

    Use this method when you want to proxy (and convert) nsIStreamListener callbacks asynchronously.

    Returns

    A nsIStreamListener that receives data via its OnDataAvailable() method.

    Parameters

    • aFromType: string

      The MIME type of the original/raw data.

    • aToType: string

      The MIME type of the converted data.

    • aListener: nsIStreamListener

      The listener that receives the converted data.

    • aContext: nsISupports

    Returns nsIStreamListener

  • Tests whether conversion between the two specified types is possible. This is cheaper than calling convert()/asyncConvertData(); it is not necessary to call this function before calling one of those, though.

    Parameters

    • aFromType: string
    • aToType: string

    Returns boolean

  • SYNCHRONOUS VERSION Converts a stream of one type, to a stream of another type.

    Use this method when you have a stream you want to convert.

    Returns

    The converted stream. NOTE: The returned stream may not already be converted. An efficient stream converter implementation will convert data on demand rather than buffering the converted data until it is used.

    Parameters

    • aFromStream: nsIInputStream

      The stream representing the original/raw data.

    • aFromType: string

      The MIME type of aFromStream.

    • aToType: string

      The MIME type of the returned stream.

    • aContext: nsISupports

      Either an opaque context, or a converter specific context (implementation specific).

    Returns nsIInputStream

  • Returns the content type that will be returned from a converter created with aFromType and * . Can fail if no converters support this conversion, or if the output type isn't known in advance.

    Parameters

    • aFromType: string
    • aChannel: nsIChannel

    Returns string

Generated using TypeDoc