Пример #1
0
        /// <summary>
        /// Encode the name component to the encoder as NDN-TLV. This handles different
        /// component types such as ImplicitSha256DigestComponent.
        /// </summary>
        ///
        /// <param name="component">The name component to encode.</param>
        /// <param name="encoder">The TlvEncoder to receive the encoding.</param>
        private static void encodeNameComponent(Name.Component component,
				TlvEncoder encoder)
        {
            int type = (component.isImplicitSha256Digest()) ? net.named_data.jndn.encoding.tlv.Tlv.ImplicitSha256DigestComponent
                    : net.named_data.jndn.encoding.tlv.Tlv.NameComponent;
            encoder.writeBlobTlv(type, component.getValue().buf());
        }