An implementation of XMLDecoder for the Binary (ccnb) codec. More...
Public Member Functions | |
BinaryXMLDecoder (BinaryXMLDictionary dictionary) | |
void | initializeDecoding () |
Default implementation does nothing. | |
void | readStartDocument () throws ContentDecodingException |
Reads the document start marker, if there is one. | |
void | readEndDocument () throws ContentDecodingException |
Reads the document end marker, if there is one. | |
void | readStartElement (String startTag, TreeMap< String, String > attributes) throws ContentDecodingException |
Reads an expected element start tag from the stream, extracting any attributes that are present on the tag. | |
void | readStartElement (long startTag, TreeMap< String, String > attributes) throws ContentDecodingException |
Reads an expected element start tag from the stream, extracting any attributes that are present on the tag. | |
void | readAttributes (TreeMap< String, String > attributes) throws ContentDecodingException |
String | peekStartElementAsString () throws ContentDecodingException |
Pulls the next tag out of the stream and then resets the stream to the point before that tag. | |
Long | peekStartElementAsLong () throws ContentDecodingException |
Pulls the next tag out of the stream and then resets the stream to the point before that tag. | |
void | readEndElement () throws ContentDecodingException |
Reads an end element from the stream, if this codec has end elements. | |
String | readUString () throws ContentDecodingException |
Read a UString. | |
byte[] | readBlob () throws ContentDecodingException |
Read a BLOB. | |
CCNTime | readDateTime (String startTag) throws ContentDecodingException |
Read and parse a timestamp from the stream. | |
CCNTime | readDateTime (long startTag) throws ContentDecodingException |
Read and parse a timestamp from the stream. | |
Static Protected Attributes | |
static final int | MARK_LEN = 512 |
static final int | DEBUG_MAX_LEN = 32768 |
An implementation of XMLDecoder for the Binary (ccnb) codec.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.initializeDecoding | ( | ) |
Default implementation does nothing.
Subclass-specific parser setup.
Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLDecoder.
Long org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.peekStartElementAsLong | ( | ) | throws ContentDecodingException |
Pulls the next tag out of the stream and then resets the stream to the point before that tag.
Requires the underlying stream to return true from InputStream.markSupported().
ContentDecodingException | if there is an error reading the stream or decoding the tag |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
String org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.peekStartElementAsString | ( | ) | throws ContentDecodingException |
Pulls the next tag out of the stream and then resets the stream to the point before that tag.
Requires the underlying stream to return true from InputStream.markSupported().
ContentDecodingException | if there is an error reading the stream or decoding the tag |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
byte [] org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readBlob | ( | ) | throws ContentDecodingException |
Read a BLOB.
Force this to consume the end element to match the behavior on the text side.
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
CCNTime org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readDateTime | ( | long | startTag | ) | throws ContentDecodingException |
Read and parse a timestamp from the stream.
startTag | expected start tag |
ContentDecodingException | if startTag is not the next tag in the stream, or there is an error decoding the element or parsing the integer |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
CCNTime org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readDateTime | ( | String | startTag | ) | throws ContentDecodingException |
Read and parse a timestamp from the stream.
startTag | expected start tag |
ContentDecodingException | if startTag is not the next tag in the stream, or there is an error decoding the element or parsing the integer |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readEndDocument | ( | ) | throws ContentDecodingException |
Reads the document end marker, if there is one.
ContentDecodingException | if there is an error in decoding |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readEndElement | ( | ) | throws ContentDecodingException |
Reads an end element from the stream, if this codec has end elements.
ContentDecodingException | if the next element in the stream is not an end element, or there is another error reading |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readStartDocument | ( | ) | throws ContentDecodingException |
Reads the document start marker, if there is one.
ContentDecodingException | if there is an error in decoding |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readStartElement | ( | long | startTag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentDecodingException |
Reads an expected element start tag from the stream, extracting any attributes that are present on the tag.
startTag | next tag we expect to occur | |
attributes | map into which we store (attribute, value) pairs |
ContentDecodingException | if that tag does not occur, or another error is encountered |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readStartElement | ( | String | startTag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentDecodingException |
Reads an expected element start tag from the stream, extracting any attributes that are present on the tag.
startTag | next tag we expect to occur | |
attributes | map into which we store (attribute, value) pairs |
ContentDecodingException | if that tag does not occur, or another error is encountered |
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.
String org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readUString | ( | ) | throws ContentDecodingException |
Read a UString.
Force this to consume the end element to match the behavior on the text side.
Implements org.ccnx.ccn.impl.encoding.XMLDecoder.