net.named_data.jndn.encoding
public class WireFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ENABLE_NDNX
NDNx support and binary XML (ccnb or ndnb) encoding is deprecated and code
with throw an exception.
|
| 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 |
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 |
decodeForwardingEntry(ForwardingEntry forwardingEntry,
ByteBuffer input)
Decode input as a forwarding entry and set the fields of the
forwardingEntry 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 |
decodeLocalControlHeader(LocalControlHeader localControlHeader,
ByteBuffer input)
Decode input as a LocalControlHeader in NDN-TLV and set the fields of the
localControlHeader 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 |
encodeData(Data data)
Encode data and return the encoding.
|
Blob |
encodeData(Data data,
int[] signedPortionBeginOffset,
int[] signedPortionEndOffset)
Encode data and return the encoding.
|
Blob |
encodeForwardingEntry(ForwardingEntry forwardingEntry)
Encode forwardingEntry 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 |
encodeLocalControlHeader(LocalControlHeader localControlHeader)
Encode the LocalControlHeader in NDN-TLV 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 static boolean ENABLE_NDNX
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(const 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(const 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 encodeForwardingEntry(ForwardingEntry forwardingEntry)
forwardingEntry - The ForwardingEntry object to encode.UnsupportedOperationException - for unimplemented if the derived
class does not override.public void decodeForwardingEntry(ForwardingEntry forwardingEntry, ByteBuffer input) throws EncodingException
forwardingEntry - The ForwardingEntry 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 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 Blob encodeLocalControlHeader(LocalControlHeader localControlHeader)
localControlHeader - The LocalControlHeader object to encode.UnsupportedOperationException - for unimplemented if the derived
class does not override.public void decodeLocalControlHeader(LocalControlHeader localControlHeader, ByteBuffer input) throws EncodingException
localControlHeader - The LocalControlHeader 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 encodingUnsupportedOperationException - 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 © 2015. All rights reserved.