net.named_data.jndn.encoding
public class WireFormat extends Object
Constructor and Description |
---|
WireFormat() |
Modifier and Type | Method and Description |
---|---|
void |
decodeControlParameters(ControlParameters controlParameters,
ByteBuffer input)
Decode input as a control parameters and set the fields of the
controlParameters object.
|
void |
decodeControlResponse(ControlResponse controlResponse,
ByteBuffer input)
Decode input as a control parameters and set the fields of the
controlResponse object.
|
void |
decodeData(Data data,
ByteBuffer input)
Decode input as a data packet and set the fields in the data object.
|
void |
decodeData(Data data,
ByteBuffer input,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Decode input as a data packet and set the fields in the data object.
|
void |
decodeDelegationSet(DelegationSet delegationSet,
ByteBuffer input)
Decode input as a delegation set and set the fields of the
delegationSet object.
|
void |
decodeEncryptedContent(EncryptedContent encryptedContent,
ByteBuffer input)
Decode input as an EncryptedContent and set the fields of the
encryptedContent object.
|
void |
decodeInterest(Interest interest,
ByteBuffer input)
Decode input as an interest and set the fields of the interest object.
|
void |
decodeInterest(Interest interest,
ByteBuffer input,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Decode input as an interest and set the fields of the interest object.
|
void |
decodeLpPacket(LpPacket lpPacket,
ByteBuffer input)
Decode input as an LpPacket and set the fields of the lpPacket object.
|
void |
decodeName(Name name,
ByteBuffer input)
Decode input as a name and set the fields of the Name object.
|
Signature |
decodeSignatureInfoAndValue(ByteBuffer signatureInfo,
ByteBuffer signatureValue)
Decode signatureInfo as a signature info and signatureValue as the related
SignatureValue, and return a new object which is a subclass of Signature.
|
Blob |
encodeControlParameters(ControlParameters controlParameters)
Encode controlParameters and return the encoding.
|
Blob |
encodeControlResponse(ControlResponse controlResponse)
Encode controlResponse and return the encoding.
|
Blob |
encodeData(Data data)
Encode data and return the encoding.
|
Blob |
encodeData(Data data,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Encode data and return the encoding.
|
Blob |
encodeDelegationSet(DelegationSet delegationSet)
Encode delegationSet and return the encoding.
|
Blob |
encodeEncryptedContent(EncryptedContent encryptedContent)
Encode the EncryptedContent and return the encoding.
|
Blob |
encodeInterest(Interest interest)
Encode interest and return the encoding.
|
Blob |
encodeInterest(Interest interest,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Encode interest and return the encoding.
|
Blob |
encodeName(Name name)
Encode name and return the encoding.
|
Blob |
encodeSignatureInfo(Signature signature)
Encode signature as a SignatureInfo and return the encoding.
|
Blob |
encodeSignatureValue(Signature signature)
Encode the signatureValue in the Signature object as a SignatureValue (the
signature bits) and return the encoding.
|
static WireFormat |
getDefaultWireFormat()
Return the default WireFormat used by default encoding and decoding methods
which was set with setDefaultWireFormat.
|
static void |
setDefaultWireFormat(WireFormat wireFormat)
Set the static default WireFormat used by default encoding and decoding
methods.
|
public Blob encodeName(Name name)
name
- The Name object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeName(Name name, ByteBuffer input) throws EncodingException
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)
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).
If you are not encoding in order to sign, you can call
encodeInterest(Interest interest) to ignore this returned value.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).
If you are not encoding in order to sign, you can call
encodeInterest(Interest interest) to ignore this returned value.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public final Blob encodeInterest(Interest interest)
interest
- The Interest object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeInterest(Interest interest, ByteBuffer input, int[] signedPortionBeginOffset, int[] signedPortionEndOffset) throws EncodingException
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).
If you are not decoding in order to verify, you can call
decodeInterest(Interest interest, ByteBuffer input)
to ignore this returned value.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).
If you are not decoding in order to verify, you can call
decodeInterest(Interest interest, ByteBuffer input)
to ignore this returned value.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public final void decodeInterest(Interest interest, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeData(Data data, int[] signedPortionBeginOffset, int[] signedPortionEndOffset)
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public final Blob encodeData(Data data)
data
- The Data object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeData(Data data, ByteBuffer input, int[] signedPortionBeginOffset, int[] signedPortionEndOffset) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public final void decodeData(Data data, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeControlParameters(ControlParameters controlParameters)
controlParameters
- The ControlParameters object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeControlParameters(ControlParameters controlParameters, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeControlResponse(ControlResponse controlResponse)
controlResponse
- The ControlResponse object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeControlResponse(ControlResponse controlResponse, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeSignatureInfo(Signature signature)
signature
- An object of a subclass of Signature to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public Signature decodeSignatureInfoAndValue(ByteBuffer signatureInfo, ByteBuffer signatureValue) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeSignatureValue(Signature signature)
signature
- An object of a subclass of Signature with the signature
value to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeLpPacket(LpPacket lpPacket, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public Blob encodeDelegationSet(DelegationSet delegationSet)
delegationSet
- The DelegationSet object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeDelegationSet(DelegationSet delegationSet, ByteBuffer input) throws EncodingException
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.UnsupportedOperationException
- for unimplemented if the derived
class does not override.EncodingException
- For invalid encoding.public Blob encodeEncryptedContent(EncryptedContent encryptedContent)
encryptedContent
- The EncryptedContent object to encode.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public void decodeEncryptedContent(EncryptedContent encryptedContent, ByteBuffer input) throws EncodingException
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 encoding.UnsupportedOperationException
- for unimplemented if the derived
class does not override.public static void setDefaultWireFormat(WireFormat wireFormat)
wireFormat
- An object of a subclass of WireFormat. This does not
make a copy.public static WireFormat getDefaultWireFormat()
Copyright © 2016. All rights reserved.