Pointer to the current plug-in instance. Pointer to the current stream. Length in bytes of buf. Buffer of data delivered for the stream.
- If successful, the function returns a positive integer representing the number of bytes written (consumed by the browser). This number depends on the size of the browser's memory buffers, the number of active streams, and other factors.
- If unsuccessful, the plug-in returns a negative integer. This indicates that the browser encountered an error while processing the data, so the plug-in should terminate the stream by calling NPN_DestroyStream.
NPN_Write delivers a buffer from the stream to the instance. A plug-in can call this function multiple times after creating a stream with NPN_NewStream. The browser makes a copy of the buffer if necessary, so the plug-in can free the buffer as the method returns, if desired. See "Example of Sending a Stream" for an example that includes NPN_Write.