org.ccnx.ccn.impl.encoding.BinaryXMLDecoder Class Reference

An implementation of XMLDecoder for the Binary (ccnb) codec. More...

Inheritance diagram for org.ccnx.ccn.impl.encoding.BinaryXMLDecoder:

org.ccnx.ccn.impl.encoding.GenericXMLDecoder org.ccnx.ccn.impl.encoding.XMLDecoder org.ccnx.ccn.impl.encoding.XMLDecoder

List of all members.

Public Member Functions

 BinaryXMLDecoder (XMLDictionary 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


Detailed Description

An implementation of XMLDecoder for the Binary (ccnb) codec.

See also:
BinaryXMLCodec

XMLDecoder


Member Function Documentation

void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.initializeDecoding (  ) 

Default implementation does nothing.

Subclass-specific parser setup.

Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLDecoder.

void org.ccnx.ccn.impl.encoding.BinaryXMLDecoder.readStartDocument (  )  throws ContentDecodingException

Reads the document start marker, if there is one.

Exceptions:
ContentDecodingException if there is an error in decoding

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.

Exceptions:
ContentDecodingException if there is an error in decoding

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.

Parameters:
startTag next tag we expect to occur
attributes map into which we store (attribute, value) pairs
Exceptions:
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 ( 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.

Parameters:
startTag next tag we expect to occur
attributes map into which we store (attribute, value) pairs
Exceptions:
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.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().

Returns:
the next tag found
Exceptions:
ContentDecodingException if there is an error reading the stream or decoding the tag

Implements org.ccnx.ccn.impl.encoding.XMLDecoder.

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().

Returns:
the next tag found, or null if not a start element
Exceptions:
ContentDecodingException if there is an error reading the stream or decoding the tag

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.

Exceptions:
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.

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.

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 ( String  startTag  )  throws ContentDecodingException

Read and parse a timestamp from the stream.

Parameters:
startTag expected start tag
Returns:
the decoded timestamp, using a quantized CCNTime
Exceptions:
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 ( long  startTag  )  throws ContentDecodingException

Read and parse a timestamp from the stream.

Parameters:
startTag expected start tag
Returns:
the decoded timestamp, using a quantized CCNTime
Exceptions:
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.


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:44:52 2012 for Content-Centric Networking in Java by  doxygen 1.5.6