| synopsis || return value || arguments || prev |
virtual int encode_id( kdu_byte * dest, int databin_class, int stream_id, kdu_long bin_id, bool is_final, bool extended=false)
[Declared in "../apps/kdu_server/kdu_serve.h"]
Encodes the indicated data-bin identifier for the indicated data-bin class into a whole number of bytes which are recorded in the dest buffer. If dest is NULL, the function only simulates the process, returning the total number of bytes which would have been written. Since the ID encoding rules can be state dependent (as in JPIP), we note that simulation does not have any impact on state, so the results might only be valid when simulating the encoding of a data-bin ID for the first message following a fully encoded message.
The actual number of bytes occupied by the data-bin identifier written to the dest array. This number of bytes includes the number of bytes required to represent the databin class, the codestream-id value, and the value of the is_final flag. It does not include the cost of encoding auxiliary information associated with extended headers.
Currently one of KDU_MAIN_HEADER_DATABIN, KDU_TILE_HEADER_DATABIN, KDU_PRECINCT_DATABIN, KDU_TILE_DATABIN or KDU_META_DATABIN, although new classes might be created in the future.
Identifier of the code-stream to which the data-bin belongs. Must be non-negative. As a general rule, use 0 unless the target object you are transporting has multiple code-streams to distinguish.
See the description of kdu_serve::generate_increments for a discussion of the identifiers which can be supplied for each data-bin class.
If true, the data-bin identifier is being used to signal the final contribution to that data-bin. This fact must be encoded into the identifier itself, at least for message headers defined by the JPIP standard.
If true, this message header has an extended form. For the JPIP standard, this means that an extra VBAS (see general introduction to the present kds_id_encoder object) appears at the end of the header. The extended VBAS is not encoded by this function, but the class code will be adjusted to reflect the presence of the extended VBAS if this flag is set to true. The general policy, at least for JPIP, is that extended message headers contain additional information which is not strictly required for correct interpretation of the message contents, but may be useful to some clients.
| top || synopsis || return value || arguments || prev |