public class Asn1XerEncodeBuffer extends Asn1EncodeByteBuffer implements Asn1XerEncoder
mByteIndex, mData
INITIAL_SIZE
context, mTypeCode
Constructor and Description |
---|
Asn1XerEncodeBuffer()
The default constructor creates an XER encode buffer object with
the default initial size and canonical set to false.
|
Asn1XerEncodeBuffer(boolean canonical)
The parameterized constructor creates an XER encode buffer object
with default initial size and canonical set to the given values.
|
Asn1XerEncodeBuffer(boolean canonical,
int size)
The parameterized constructor creates an XER encode buffer object
with initial size increment and canonical set to the given values.
|
Modifier and Type | Method and Description |
---|---|
void |
binDump(java.io.PrintStream out,
java.lang.String varName)
This method dumps the encoded message in a human-readable format
showing a bit trace of all fields to the given print output stream.
|
void |
copy(java.lang.String value)
This method copies a character string to the encode buffer.
|
void |
decrLevel()
This method decrements the element nesting level counter.
|
void |
encodeBinStrValue(byte[] bits,
int nbits)
This method encodes XML binary string data
|
void |
encodeByte(byte value)
This method is used to encode a single byte to the encode buffer.
|
void |
encodeData(java.lang.String value)
This method encodes XML string data
|
void |
encodeEmptyElement(java.lang.String elemName)
This method encodes an XML empty element tag
|
void |
encodeEndDocument()
This method encodes standard trailor information at the end
of the XML document.
|
void |
encodeEndElement(java.lang.String elemName)
This method encodes an XML end element tag
|
void |
encodeHexStrValue(byte[] data)
This method encodes XML hexadecimal string data
|
void |
encodeNamedValue(java.lang.String valueName,
java.lang.String elemName)
This method encodes an XML named value (with start and end tags)
|
void |
encodeNamedValueElement(java.lang.String elemName)
This method encodes an XML named value element tag
|
void |
encodeRealValue(double value,
java.lang.String elemName)
This method encodes an XML REAL (double) value (with start and end tags).
|
void |
encodeStartDocument()
This method encodes standard header information at the beginning
of the XML document.
|
void |
encodeStartElement(java.lang.String elemName)
This method encodes an XML start element tag
|
int |
getState()
This method gets the state of the buffer.
|
void |
incrLevel()
This method increments the element nesting level counter.
|
void |
indent()
This methods indents by adding a new-line followed by whitespace
corresponding to the current nesting level to the encode buffer.
|
boolean |
isCanonical()
Return true if the encoder has been put into canonical mode.
|
void |
setCanonical(boolean value)
This method sets the canonical encoding flag to the given value.
|
void |
setState(int stat)
This method sets the state of the buffer.
|
checkSize, copy, copy, copy, copyUnsafe, getBuffer, getByteArrayInputStream, getMsgCopy, getMsgLength, initBuffer, reset, write
binDump, encodeIntSigned, encodeIntUnsigned, getInputStream, getMinimalOctetsSigned, getMinimalOctetsUnsigned, getOutputStream, hexDump, hexDump
addNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
getContext, hexDump, hexDump, setKey, setTypeCode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copy, copy, copy, getContext
public Asn1XerEncodeBuffer()
public Asn1XerEncodeBuffer(boolean canonical)
canonical
- Boolean indicating a canonical or non-canonical
encoding should be produced as defined in the X.693 standard.public Asn1XerEncodeBuffer(boolean canonical, int size)
canonical
- Boolean indicating a canonical or non-canonical
encoding should be produced as defined in the X.693 standard.size
- The initial size in bytes of an encode buffer. If
this parameter is set to zero, the default size will be used.public void binDump(java.io.PrintStream out, java.lang.String varName)
binDump
in class Asn1EncodeBuffer
out
- stream to print to.varName
- Variable name to include in output.public void copy(java.lang.String value) throws Asn1Exception
copy
in interface Asn1XmlXerEncoder
value
- The string value to copyAsn1Exception
- Thrown, if operation is failed.public void decrLevel()
decrLevel
in interface Asn1XmlXerEncoder
public void encodeByte(byte value)
value
- The byte value to copypublic void encodeData(java.lang.String value) throws Asn1Exception
encodeData
in interface Asn1XmlXerEncoder
value
- String value to encodeAsn1Exception
- Thrown, if operation is failed.public void encodeBinStrValue(byte[] bits, int nbits) throws Asn1Exception
encodeBinStrValue
in interface Asn1XmlXerEncoder
bits
- Bit string to encodeAsn1Exception
- Thrown, if operation is failed.public void encodeHexStrValue(byte[] data) throws Asn1Exception
encodeHexStrValue
in interface Asn1XmlXerEncoder
data
- Data to encodeAsn1Exception
- Thrown, if operation is failed.public void encodeEndDocument() throws Asn1Exception
encodeEndDocument
in interface Asn1XmlXerEncoder
Asn1Exception
- Thrown, if operation is failed.public void encodeEndElement(java.lang.String elemName) throws Asn1Exception
encodeEndElement
in interface Asn1XerEncoder
elemName
- The name of element.Asn1Exception
- Thrown, if operation is failed.public void encodeStartDocument() throws Asn1Exception
encodeStartDocument
in interface Asn1XmlXerEncoder
Asn1Exception
- Thrown, if operation is failed.public void encodeStartElement(java.lang.String elemName) throws Asn1Exception
encodeStartElement
in interface Asn1XerEncoder
elemName
- The name of element.Asn1Exception
- Thrown, if operation is failed.public void encodeEmptyElement(java.lang.String elemName) throws Asn1Exception
encodeEmptyElement
in interface Asn1XerEncoder
elemName
- The name of element.Asn1Exception
- Thrown, if operation is failed.public void encodeNamedValueElement(java.lang.String elemName) throws Asn1Exception
encodeNamedValueElement
in interface Asn1XmlXerEncoder
elemName
- The name of element.Asn1Exception
- Thrown, if operation is failed.public void encodeRealValue(double value, java.lang.String elemName) throws java.io.IOException, Asn1Exception
encodeRealValue
in interface Asn1XerEncoder
value
- The value to be encoded.elemName
- The name of element. If null, then start and end
tags won't be encoded.java.io.IOException
- If I/O error occurs.Asn1Exception
- Thrown, if operation is failed.public int getState()
getState
in interface Asn1XerEncoder
public void incrLevel()
incrLevel
in interface Asn1XmlXerEncoder
public void indent() throws Asn1Exception
indent
in interface Asn1XmlXerEncoder
Asn1Exception
- Thrown, if operation is failed.public boolean isCanonical()
Asn1XmlXerEncoder
isCanonical
in interface Asn1XmlXerEncoder
Asn1XmlXerEncoder
public void setCanonical(boolean value)
value
- Canonical encoding flag.public void setState(int stat)
setState
in interface Asn1XerEncoder
stat
- Buffer Statpublic void encodeNamedValue(java.lang.String valueName, java.lang.String elemName) throws Asn1Exception
encodeNamedValue
in interface Asn1XerEncoder
valueName
- The name of value.elemName
- The name of element.Asn1Exception
- Thrown, if operation is failed.