writePacketBody Method (CodestreamWriter)
In This Topic
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.
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.
Syntax
Parameters
- body
- The packet body data.
- blen
- The number of bytes in the packet body.
- sim
- Simulation mode flag. If true nothing is written to the bit stream, but the number of bytes that would be written is returned.
- roiInPkt
- Whether or not there is ROI information in this packet
- roiLen
- Number of byte to read in packet body to get all the ROI information
Return Value
The number of bytes spent by the packet body.
Exceptions
Exception | Description |
IOException | If an I/O error occurs while writing to the
output stream.
|
See Also