[]
Writes a packet body to the codestream and returns the number of bytes used by this body. If in simulation mode then no data is written to the bit stream but the number of bytes is calculated. This can be used for iterative rate allocation.
<p>If the number of bytes that has to be written to the codestream is
more than the space left (as returned by getMaxAvailableBytes()), only
the data that does not exceed the allowed length is effectively written
and the rest is discarded. However the value returned by the method is
the total length of the packet, as if all of it was written to the bit
stream.</p>
public override int writePacketBody(byte[] body, int blen, bool sim, bool roiInPkt, int roiLen)
Type | Name | Description |
---|---|---|
byte[] | body | The packet body data. |
int | blen | The number of bytes in the packet body. |
bool | sim | Simulation mode flag. If true nothing is written to the bit stream, but the number of bytes that would be written is returned. |
bool | roiInPkt | Whether or not there is ROI information in this packet |
int | roiLen | Number of byte to read in packet body to get all the ROI information |
Type | Description |
---|---|
int | The number of bytes spent by the packet body. |