* Encode the initial vocabulary of a fast infoset document.
*
*/
protected final void encodeInitialVocabulary() throws IOException {
if (_v == null) {
_v = new SerializerVocabulary();
_vIsInternal = true;
} else if (_vIsInternal) {
_v.clear();
if (_vData != null)
_vData.clear();
}
if (!_v.hasInitialVocabulary() && !_v.hasExternalVocabulary()) {
write(0);
} else if (_v.hasInitialVocabulary()) {
_b = EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG;
write(_b);
SerializerVocabulary initialVocabulary = _v.getReadOnlyVocabulary();
// TODO check for contents of vocabulary to assign bits
if (initialVocabulary.hasExternalVocabulary()) {
_b = EncodingConstants.INITIAL_VOCABULARY_EXTERNAL_VOCABULARY_FLAG;
write(_b);
write(0);
}
if (initialVocabulary.hasExternalVocabulary()) {
encodeNonEmptyOctetStringOnSecondBit(_v.getExternalVocabularyURI());
}
// TODO check for contents of vocabulary to encode values
} else if (_v.hasExternalVocabulary()) {