ComponentOne PdfViewer for WPF and Silverlight
C1.WPF.PdfViewer.4.6.2 Assembly / CSJ2K.j2k.codestream.writer Namespace / CodestreamWriter Class / writePacketBody Method
The packet body data.
The number of bytes in the packet body.
Simulation mode flag. If true nothing is written to the bit stream, but the number of bytes that would be written is returned.
Whether or not there is ROI information in this packet
Number of byte to read in packet body to get all the ROI information

In This Topic
    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
    'Declaration
     
    
    Public MustOverride Function writePacketBody( _
       ByVal body() As Byte, _
       ByVal blen As Integer, _
       ByVal sim As Boolean, _
       ByVal roiInPkt As Boolean, _
       ByVal roiLen As Integer _
    ) As Integer
    public abstract int writePacketBody( 
       byte[] body,
       int blen,
       bool sim,
       bool roiInPkt,
       int roiLen
    )

    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
    ExceptionDescription
    If an I/O error occurs while writing to the output stream.
    See Also