Class: BinaryXmlWireFormat

BinaryXmlWireFormat

new BinaryXmlWireFormat()

A BinaryXmlWireFormat implements the WireFormat interface for encoding and decoding in binary XML.
Source:

Methods

(static) decodeData(data, decoder) → {object}

Use the decoder to place the result in data.
Parameters:
Name Type Description
data Data
decoder BinaryXMLDecoder
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion.
Type
object

(static) decodeInterest(interest, decoder) → {object}

Use the decoder to place the result in interest.
Parameters:
Name Type Description
interest Interest
decoder BinaryXMLDecoder
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
Type
object

(static) encodeData(data, encoder) → {object}

Encode the data by calling the operations on the encoder.
Parameters:
Name Type Description
data Data
encoder BinaryXMLEncoder
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion.
Type
object

(static) encodeInterest(interest, encoder) → {object}

Encode the interest by calling the operations on the encoder.
Parameters:
Name Type Description
interest Interest
encoder BinaryXMLEncoder
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
Type
object

(static) get() → {BinaryXmlWireFormat}

Get a singleton instance of a BinaryXmlWireFormat. Assuming that the default wire format was set with WireFormat.setDefaultWireFormat(BinaryXmlWireFormat.get()), you can check if this is the default wire encoding with if WireFormat.getDefaultWireFormat() == BinaryXmlWireFormat.get().
Source:
Returns:
The singleton instance.
Type
BinaryXmlWireFormat

decodeContentObject()

Deprecated:
  • Use decodeData(data, input).
Source:

decodeData(data, input) → {object}

Decode input as a Binary XML data packet, set the fields in the data object, and return the signed offsets.
Parameters:
Name Type Description
data Data The Data object whose fields are updated.
input Buffer The buffer with the bytes to decode.
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion.
Type
object

decodeInterest(interest, input) → {object}

Decode input as a Binary XML interest and set the fields of the interest object.
Parameters:
Name Type Description
interest Interest The Interest object whose fields are updated.
input Buffer The buffer with the bytes to decode.
Source:
Returns:
An associative array with fields (signedPortionBeginOffset, signedPortionEndOffset) where signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
Type
object

decodeName(name, input)

Decode input as a Binary XML name and set the fields of the Name object.
Parameters:
Name Type Description
name Name The Name object whose fields are updated.
input Buffer The buffer with the bytes to decode.
Source:

encodeContentObject()

Deprecated:
  • Use encodeData(data).
Source:

encodeData(data) → {object}

Encode data as Binary XML and return the encoding and signed offsets.
Parameters:
Name Type Description
data Data The Data object to encode.
Source:
Returns:
An associative array with fields (encoding, signedPortionBeginOffset, signedPortionEndOffset) where encoding is a Blob containing the encoding, signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion.
Type
object

encodeInterest(interest) → {object}

Encode interest as Binary XML and return the encoding.
Parameters:
Name Type Description
interest Interest The Interest to encode.
Source:
Returns:
An associative array with fields (encoding, signedPortionBeginOffset, signedPortionEndOffset) where encoding is a Blob containing the encoding, signedPortionBeginOffset is the offset in the encoding of the beginning of the signed portion, and signedPortionEndOffset is the offset in the encoding of the end of the signed portion. The signed portion starts from the first name component and ends just before the final name component (which is assumed to be a signature for a signed interest).
Type
object

encodeName(interest) → {Blobl}

Encode interest as Binary XML and return the encoding.
Parameters:
Name Type Description
interest Name The Name to encode.
Source:
Returns:
A Blob containing the encoding.
Type
Blobl