NPByteRange

« Gecko Plugin API Reference « Plug-in Side Plug-in API

Summary

Represents a particular range of bytes from a stream.

Syntax

typedef struct _NPByteRange
{
    int32  offset;  /* negative offset = from the end */
    uint32 length;
    struct _NPByteRange* next;
} NPByteRange;

Fields

The data structure has the following fields:

offset
Offset in bytes to the start of the requested range. This value may be either positive or negative:
  • Positive value: Offset from the beginning of the stream.
  • Negative value: Offset from the end of the stream.
length
Number of bytes to fetch from the specified offset.
next
Points to the next NPByteRange request in the list of requests, or null if this is the last request.

Description

The plug-in seeks within a stream by building a linked list of one or more NPByteRange objects, which represents a set of discontiguous byte ranges. The only plug-in API call that uses the NPByteRange type is NPN_RequestRead(), which lets the plug-in read specified parts of a file without downloading it.

The plug-in is responsible for deleting NPByteRange objects when finished with them. The browser makes a copy if it needs to keep the objects beyond the call to NPN_RequestRead().

See Also

NPN_RequestRead()

Document Tags and Contributors

Tags: 
 Contributors to this page: teoli, Sheppy, Pmash
 Last updated by: teoli,