nsIStringInputStream

IID:450cd2d4-f0fd-424d-b365-b1251f80fd53
Inherits From:nsIInputStream

Provides scriptable and specialized C++ only methods for initializing a nsIInputStream implementation with a simple character array.

This interface is intended to be used as an instance. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/io/string-input-stream;1"].
            createInstance(Components.interfaces.nsIStringInputStream);

This interface is implemented by the following components:


Methods

[noscript] void adoptData ( charPtr* data , PRInt32 datlen ) void setData ( char* data , PRInt32 datlen ) [noscript] void shareData ( char* data , PRInt32 datlen )

void adoptData ( charPtr* data , PRInt32 datlen )

AdoptData - assign data to the input stream. the input stream takes ownership of the given data buffer and will nsMemory::Free it when the input stream is destroyed.

Arguments:
data: - stream data
datlen: - stream data length (-1 if length should be computed)

void setData ( char* data , PRInt32 datlen )

SetData - assign data to the input stream (copied on assignment).

NOTE: C++ code should consider using AdoptData or ShareData to avoid making an extra copy of the stream data.

Arguments:
data: - stream data
datlen: - stream data length (-1 if length should be computed)

void shareData ( char* data , PRInt32 datlen )

ShareData - assign data to the input stream. the input stream references the given data buffer until the input stream is destroyed. the given data buffer must outlive the input stream.

Arguments:
data: - stream data
datlen: - stream data length (-1 if length should be computed)

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com