Public Member Functions | |
void | beginEncoding (OutputStream ostream) throws ContentEncodingException |
Initiates encoding and handles any startup steps, including writing the start document if one is defined for this codec. | |
void | endEncoding () throws ContentEncodingException |
Handles any necessary steps for ending the encoding, including writing the end document if one is defined for this codec. | |
void | writeStartElement (String tag) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream. | |
void | writeStartElement (long tag) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream. | |
void | writeStartElement (String tag, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes. | |
void | writeStartElement (long tag, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes. | |
void | writeEndElement () throws ContentEncodingException |
Writes the end element defined by this codec to the stream. | |
void | writeElement (String tag, String utf8Content) throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec. | |
void | writeElement (long tag, String utf8Content) throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec. | |
void | writeElement (String tag, String utf8Content, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec. | |
void | writeElement (long tag, String utf8Content, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec. | |
void | writeElement (String tag, byte[] binaryContent) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (long tag, byte[] binaryContent) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (String tag, byte[] binaryContent, int offset, int length) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (long tag, byte[] binaryContent, int offset, int length) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (String tag, byte[] binaryContent, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (long tag, byte[] binaryContent, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (String tag, byte[] binaryContent, int offset, int length, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (long tag, byte[] binaryContent, int offset, int length, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (String tag, long value) throws ContentEncodingException |
Writes a number to the stream formatted according to this codec. | |
void | writeElement (long tag, long value) throws ContentEncodingException |
Writes a number to the stream formatted according to this codec. | |
void | writeDateTime (String tag, CCNTime dateTime) throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec. | |
void | writeDateTime (long tag, CCNTime dateTime) throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec. | |
void | writeUString (String utf8Content) throws ContentEncodingException |
void | writeBlob (byte[] binaryContent) throws ContentEncodingException |
void | writeBlob (byte[] binaryContent, int offset, int length) throws ContentEncodingException |
void | pushXMLDictionary (BinaryXMLDictionary dictionary) |
Some codecs use a dictionary to make encoding and decoding more efficient. | |
BinaryXMLDictionary | popXMLDictionary () |
Some codecs use a dictionary to make encoding and decoding more efficient. |
void org.ccnx.ccn.impl.encoding.XMLEncoder.beginEncoding | ( | OutputStream | ostream | ) | throws ContentEncodingException |
Initiates encoding and handles any startup steps, including writing the start document if one is defined for this codec.
ostream | the output stream to encode to |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.endEncoding | ( | ) | throws ContentEncodingException |
Handles any necessary steps for ending the encoding, including writing the end document if one is defined for this codec.
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
BinaryXMLDictionary org.ccnx.ccn.impl.encoding.XMLEncoder.popXMLDictionary | ( | ) |
Some codecs use a dictionary to make encoding and decoding more efficient.
Those codecs typically load their default dictionary automatically. This call allows a user to manipulate the dictionary stack, removing the most recently added dictionary from the set used to encode.
void org.ccnx.ccn.impl.encoding.XMLEncoder.pushXMLDictionary | ( | BinaryXMLDictionary | dictionary | ) |
Some codecs use a dictionary to make encoding and decoding more efficient.
Those codecs typically load their default dictionary automatically. This call allows a user to manipulate the dictionary stack, adding their own dictionaries to the set used to decode.
dictionary | a dictionary to add to the set used for decoding |
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeDateTime | ( | long | tag, | |
CCNTime | dateTime | |||
) | throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec.
tag | start tag to use | |
dateTime | the timestamp to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeDateTime | ( | String | tag, | |
CCNTime | dateTime | |||
) | throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec.
tag | start tag to use | |
dateTime | the timestamp to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
long | value | |||
) | throws ContentEncodingException |
Writes a number to the stream formatted according to this codec.
tag | start tag to use | |
value | the number to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
long | value | |||
) | throws ContentEncodingException |
Writes a number to the stream formatted according to this codec.
tag | start tag to use | |
value | the number to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
byte[] | binaryContent, | |||
int | offset, | |||
int | length, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
offset | the offset into binaryContent at which to start | |
length | the number of bytes of binaryContent to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent, | |||
int | offset, | |||
int | length, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
offset | the offset into binaryContent at which to start | |
length | the number of bytes of binaryContent to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
byte[] | binaryContent, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
byte[] | binaryContent, | |||
int | offset, | |||
int | length | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
offset | the offset into binaryContent at which to start | |
length | the number of bytes of binaryContent to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent, | |||
int | offset, | |||
int | length | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
offset | the offset into binaryContent at which to start | |
length | the number of bytes of binaryContent to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
byte[] | binaryContent | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
String | utf8Content, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec.
tag | start tag to use | |
utf8Content | the string data to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
String | utf8Content, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec.
tag | start tag to use | |
utf8Content | the string data to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | long | tag, | |
String | utf8Content | |||
) | throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec.
tag | start tag to use | |
utf8Content | the string data to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement | ( | String | tag, | |
String | utf8Content | |||
) | throws ContentEncodingException |
Writes a UTF-8 encoded string to the stream formatted according to this codec.
tag | start tag to use | |
utf8Content | the string data to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeEndElement | ( | ) | throws ContentEncodingException |
Writes the end element defined by this codec to the stream.
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement | ( | long | tag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes.
This does string lookup of the attribute names.
tag | the element start tag | |
attributes | the (attribute, value) pairs to write as attributes of the element start tag, if null or empty no attributes are written |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement | ( | String | tag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes.
tag | the element start tag | |
attributes | the (attribute, value) pairs to write as attributes of the element start tag, if null or empty no attributes are written |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement | ( | long | tag | ) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream.
tag | the element start tag value defined by the dictionary, to skip string processing. |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement | ( | String | tag | ) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream.
tag | the element start tag |
ContentEncodingException | if there is an error encoding or writing the content |
Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.