Buffer Parameters
Some events include one or more parameters intended for use as a binary data buffer. Depending on the event, these parameters may contain data when the event is fired, or it may be expected that the application populates them with the desired amount of data during the event handler. Some events combine both paradigms, and expect the application to modify the data already present when the event is fired.
The documentation for such events will describe which of the above cases applies to each buffer parameters. Note that, in all cases, buffer parameters point to a pre-allocated block of unmanaged memory, the size of which is specified by the parameter immediately following the buffer parameter.
Buffer parameters are always of the ByteBuffer type; use the methods of the ByteBuffer class to read and write data from and to the unmanaged memory region.