net.named_data.jndn.encoding
public class Tlv0_1_1WireFormat extends WireFormat
Constructor and Description |
---|
Tlv0_1_1WireFormat() |
Modifier and Type | Method and Description |
---|---|
void |
decodeControlParameters(ControlParameters controlParameters,
ByteBuffer input)
Decode input as a control parameters in NDN-TLV and set the fields of the
controlParameters object.
|
void |
decodeControlResponse(ControlResponse controlResponse,
ByteBuffer input)
Decode input as a control parameters in NDN-TLV and set the fields of the
controlResponse object.
|
void |
decodeData(Data data,
ByteBuffer input,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Decode input as a data packet in NDN-TLV and set the fields in the data
object.
|
void |
decodeDelegationSet(DelegationSet delegationSet,
ByteBuffer input)
Decode input as a sequence of NDN-TLV Delegation and set the fields of the
delegationSet object.
|
void |
decodeEncryptedContent(EncryptedContent encryptedContent,
ByteBuffer input)
Decode input as a EncryptedContent in NDN-TLV and set the fields of the
encryptedContent object.
|
void |
decodeInterest(Interest interest,
ByteBuffer input,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Decode input as an interest in NDN-TLV and set the fields of the interest
object.
|
void |
decodeLpPacket(LpPacket lpPacket,
ByteBuffer input)
Decode input as an NDN-TLV LpPacket and set the fields of the lpPacket object.
|
void |
decodeName(Name name,
ByteBuffer input)
Decode input as a name in NDN-TLV and set the fields of the Name object.
|
Signature |
decodeSignatureInfoAndValue(ByteBuffer signatureInfo,
ByteBuffer signatureValue)
Decode signatureInfo as an NDN-TLV signature info and signatureValue as the
related NDN-TLV SignatureValue, and return a new object which is a subclass
of Signature.
|
Blob |
encodeControlParameters(ControlParameters controlParameters)
Encode controlParameters in NDN-TLV and return the encoding.
|
Blob |
encodeControlResponse(ControlResponse controlResponse)
Encode controlResponse in NDN-TLV and return the encoding.
|
Blob |
encodeData(Data data,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Encode data in NDN-TLV and return the encoding.
|
Blob |
encodeDelegationSet(DelegationSet delegationSet)
Encode delegationSet as a sequence of NDN-TLV Delegation, and return the
encoding.
|
Blob |
encodeEncryptedContent(EncryptedContent encryptedContent)
Encode the EncryptedContent in NDN-TLV and return the encoding.
|
Blob |
encodeInterest(Interest interest,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Encode interest using NDN-TLV and return the encoding.
|
Blob |
encodeName(Name name)
Encode name in NDN-TLV and return the encoding.
|
Blob |
encodeSignatureInfo(Signature signature)
Encode signature as a SignatureInfo in NDN-TLV and return the encoding.
|
Blob |
encodeSignatureValue(Signature signature)
Encode the signatureValue in the Signature object as a SignatureValue (the
signature bits) in NDN-TLV and return the encoding.
|
static Tlv0_1_1WireFormat |
get()
Get a singleton instance of a Tlv0_1_1WireFormat.
|
decodeData, decodeInterest, encodeData, encodeInterest, getDefaultWireFormat, setDefaultWireFormat
public Blob encodeName(Name name)
encodeName
in class WireFormat
name
- The Name object to encode.public void decodeName(Name name, ByteBuffer input) throws EncodingException
decodeName
in class WireFormat
name
- The Name object whose fields are updated.input
- The input buffer to decode. This reads from position() to limit(), but does not change the position.EncodingException
- For invalid encoding.public Blob encodeInterest(Interest interest, int[] signedPortionBeginOffset, int[] signedPortionEndOffset)
encodeInterest
in class WireFormat
interest
- The Interest object to encode.signedPortionBeginOffset
- Return the offset in the encoding of the
beginning 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).signedPortionEndOffset
- Return 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).public void decodeInterest(Interest interest, ByteBuffer input, int[] signedPortionBeginOffset, int[] signedPortionEndOffset) throws EncodingException
decodeInterest
in class WireFormat
interest
- The Interest object whose fields are updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.signedPortionBeginOffset
- Return the offset in the encoding of the
beginning 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).signedPortionEndOffset
- Return 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).EncodingException
- For invalid encoding.public Blob encodeData(Data data, int[] signedPortionBeginOffset, int[] signedPortionEndOffset)
encodeData
in class WireFormat
data
- The Data object to encode.signedPortionBeginOffset
- Return the offset in the encoding of the
beginning of the signed portion by setting signedPortionBeginOffset[0].
If you are not encoding in order to sign, you can call encodeData(data) to
ignore this returned value.signedPortionEndOffset
- Return the offset in the encoding of the end
of the signed portion by setting signedPortionEndOffset[0].
If you are not encoding in order to sign, you can call encodeData(data) to
ignore this returned value.public void decodeData(Data data, ByteBuffer input, int[] signedPortionBeginOffset, int[] signedPortionEndOffset) throws EncodingException
decodeData
in class WireFormat
data
- The Data object whose fields are updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.signedPortionBeginOffset
- Return the offset in the input buffer of
the beginning of the signed portion by setting signedPortionBeginOffset[0].
If you are not decoding in order to verify, you can call
decodeData(data, input) to ignore this returned value.signedPortionEndOffset
- Return the offset in the input buffer of the
end of the signed portion by setting signedPortionEndOffset[0]. If you are
not decoding in order to verify, you can call decodeData(data, input) to
ignore this returned value.EncodingException
- For invalid encoding.public Blob encodeControlParameters(ControlParameters controlParameters)
encodeControlParameters
in class WireFormat
controlParameters
- The ControlParameters object to encode.public void decodeControlParameters(ControlParameters controlParameters, ByteBuffer input) throws EncodingException
decodeControlParameters
in class WireFormat
controlParameters
- The ControlParameters object whose fields are
updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encodingpublic Blob encodeControlResponse(ControlResponse controlResponse)
encodeControlResponse
in class WireFormat
controlResponse
- The ControlResponse object to encode.public void decodeControlResponse(ControlResponse controlResponse, ByteBuffer input) throws EncodingException
decodeControlResponse
in class WireFormat
controlResponse
- The ControlResponse object whose fields are
updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encodingpublic Blob encodeSignatureInfo(Signature signature)
encodeSignatureInfo
in class WireFormat
signature
- An object of a subclass of Signature to encode.public Signature decodeSignatureInfoAndValue(ByteBuffer signatureInfo, ByteBuffer signatureValue) throws EncodingException
decodeSignatureInfoAndValue
in class WireFormat
signatureInfo
- The signature info input buffer to decode. This reads
from position() to limit(), but does not change the position.signatureValue
- The signature value input buffer to decode. This reads
from position() to limit(), but does not change the position.EncodingException
- For invalid encoding.public Blob encodeSignatureValue(Signature signature)
encodeSignatureValue
in class WireFormat
signature
- An object of a subclass of Signature with the signature
value to encode.public void decodeLpPacket(LpPacket lpPacket, ByteBuffer input) throws EncodingException
decodeLpPacket
in class WireFormat
lpPacket
- The LpPacket object whose fields are updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encoding.public Blob encodeDelegationSet(DelegationSet delegationSet)
encodeDelegationSet
in class WireFormat
delegationSet
- The DelegationSet object to encode.public void decodeDelegationSet(DelegationSet delegationSet, ByteBuffer input) throws EncodingException
decodeDelegationSet
in class WireFormat
delegationSet
- The DelegationSet object whose fields are updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encoding.public Blob encodeEncryptedContent(EncryptedContent encryptedContent)
encodeEncryptedContent
in class WireFormat
encryptedContent
- The EncryptedContent object to encode.public void decodeEncryptedContent(EncryptedContent encryptedContent, ByteBuffer input) throws EncodingException
decodeEncryptedContent
in class WireFormat
encryptedContent
- The EncryptedContent object whose fields are
updated.input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encodingpublic static Tlv0_1_1WireFormat get()
Copyright © 2016. All rights reserved.