Static Public Member Functions | |
static String | codecName () |
The name of this codec. | |
static String | encodeBinaryElement (byte[] element) |
Encodes a binary element as base 64. | |
static String | encodeBinaryElement (byte[] element, int offset, int length) |
Encodes a binary element as base 64. | |
static byte[] | decodeBinaryElement (String element) throws IOException |
Decodes a base64-encoded binary element back into a byte array. | |
static String | formatDateTime (CCNTime dateTime) |
Encapsulate our timestamp formatting/parsing for consistency. | |
static CCNTime | parseDateTime (String strDateTime) throws ParseException |
Encapsulate our timestamp formatting/parsing for consistency. | |
Static Public Attributes | |
static final String | CCN_NAMESPACE = "http://www.parc.com/ccn" |
static final String | CCN_PREFIX = "ccn" |
static final String | CODEC_NAME = "Text" |
static final String | BINARY_ATTRIBUTE = "ccnbencoding" |
static final String | BINARY_ATTRIBUTE_VALUE = "base64Binary" |
Static Protected Attributes | |
static DateFormat | canonicalWriteDateFormat = null |
static DateFormat | canonicalReadDateFormat = null |
static final String | PAD_STRING = "000000000" |
static final int | NANO_LENGTH = 9 |
Static Package Functions | |
[static initializer] |
Close to standard text XML, though with limited support for things like namespaces. This class contains utility functions used by TextXMLEncoder and TextXMLDecoder as well as setup to use this codec with XMLCodecFactory.
static String org.ccnx.ccn.impl.encoding.TextXMLCodec.codecName | ( | ) | [static] |
The name of this codec.
Used to generate XMLEncoder and XMLDecoder instances with XMLCodecFactory.
static String org.ccnx.ccn.impl.encoding.TextXMLCodec.encodeBinaryElement | ( | byte[] | element | ) | [static] |
Encodes a binary element as base 64.
element | the element data to encode. Needs to handle null and 0-length elements |
static String org.ccnx.ccn.impl.encoding.TextXMLCodec.encodeBinaryElement | ( | byte[] | element, | |
int | offset, | |||
int | length | |||
) | [static] |
Encodes a binary element as base 64.
element | the element data to encode. Needs to handle null and 0-length elements | |
offset | the offset into element at which to start encoding | |
length | how many bytes of element to encode |
static byte [] org.ccnx.ccn.impl.encoding.TextXMLCodec.decodeBinaryElement | ( | String | element | ) | throws IOException [static] |
Decodes a base64-encoded binary element back into a byte array.
element | base64-encoded element content |
IOException | if element is not valid base64 |
static String org.ccnx.ccn.impl.encoding.TextXMLCodec.formatDateTime | ( | CCNTime | dateTime | ) | [static] |
Encapsulate our timestamp formatting/parsing for consistency.
Use a simple standard format for outputing a quantized CCNTime.
dateTime | the timestamp to encode |
static CCNTime org.ccnx.ccn.impl.encoding.TextXMLCodec.parseDateTime | ( | String | strDateTime | ) | throws ParseException [static] |
Encapsulate our timestamp formatting/parsing for consistency.
Use a simple standard format for outputing a quantized CCNTime.
strDateTime | the string-encoded timestamp |