Previous | Table of Contents | Next |
The Common Data Representation (CDR) transfer syntax is the format in which the GIOP represents OMG IDL data types in an octet
stream.
An octet stream is an abstract notion that typically corresponds to a memory buffer that is to be sent to another process
or machine over some IPC mechanism or network transport. For the purposes of this discussion, an octet stream is an arbitrarily
long (but finite) sequence of eight-bit values (octets) with a well-defined beginning. The octets in the stream are numbered
from 0 to n-1, where n is the size of the stream. The numeric position of an octet in the stream is called its index. Octet
indices are used to
calculate alignment boundaries, as described in Section 15.3.1.1, “Alignment,? on
page 15-5.
GIOP defines two distinct kinds of octet streams, messages and encapsulations. Messages are the basic units of information
exchange in GIOP, described in detail in
Section 15.4, “GIOP Message Formats,? on page 15-30.
Encapsulations are octet streams into which OMG IDL data structures may be marshaled independently, apart from any particular
message context. Once a data structure has been encapsulated, the octet stream can be represented as the OMG IDL opaque data
type sequence<octet>, which can be marshaled subsequently into a message or another encapsulation. Encapsulations allow complex
constants (such as TypeCodes) to be pre-marshaled; they also allow certain message components to be handled without requiring
full unmarshaling. Whenever encapsulations are used in CDR or the GIOP, they are clearly noted.