2.2 Top-level Binary Stream

The following table defines the top-level binary stream contained in the root element after base64 decoding.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Version

Package Parts Length

Package Parts (variable)

...

...

...

Permissions Length

Permissions (variable)

...

...

...

Metadata Length

Metadata (variable)

...

...

...

Permission Bindings Length

Permission Bindings (variable)

...

...

...

Version (4 bytes): Unsigned integer that MUST be set to 0.

Package Parts Length (4 bytes): Unsigned integer that specifies the length of the Package Parts field.

Package Parts (variable): Variable-length binary stream (section 2.3).

Permissions Length (4 bytes): Unsigned integer that specifies the length of the Permissions field.

Permissions (variable): Variable-length binary stream (section 2.4).

Metadata Length (4 bytes): Unsigned integer that specifies the length of the Metadata field.

Metadata (variable): Variable-length binary stream (section 2.5).

Permission Bindings Length (4 bytes): Unsigned integer that specifies the length of the Permission Bindings field.

Permission Bindings (variable): Variable-length binary stream (section 2.6).