public class Asn1XerOutputStream extends Asn1OutputStream implements Asn1XerEncoder
os| Constructor and Description |
|---|
Asn1XerOutputStream(java.io.OutputStream os)
This constructor creates a buffered XER output stream object with
default size of buffer.
|
Asn1XerOutputStream(java.io.OutputStream os,
boolean canonical,
int bufSize)
This constructor creates a buffered XER output stream object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(byte value)
This method is used to copy a single byte to the output stream.
|
void |
copy(byte[] value)
This method copies multiple bytes to the output stream.
|
void |
copy(byte[] value,
int off,
int len)
This method copies multiple bytes to the output stream.
|
void |
copy(java.lang.String value)
This method copies a character string to the output stream.
|
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 output stream.
|
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 output stream.
|
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.
|
void |
write(java.lang.String value)
This method copies a character string to the output stream.
|
close, flush, getContext, write, write, write, write2Bytes, write4Bytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextpublic Asn1XerOutputStream(java.io.OutputStream os)
os - The underlying OutputStream object.public Asn1XerOutputStream(java.io.OutputStream os,
boolean canonical,
int bufSize)
os - The underlying OutputStream object.canonical - Boolean indicating a canonical or non-canonical
encoding should be produced as defined in the X.693
standard.bufSize - The buffer size. If it is 0 then the output stream
is used as unbuffered.public void copy(byte value)
throws java.io.IOException
copy in interface Asn1XmlXerEncodervalue - The byte value to copyjava.io.IOException - Any exception thrown by the underlying OutputStream.public void copy(byte[] value)
throws java.io.IOException,
Asn1Exception
copy in interface Asn1XmlXerEncodervalue - Array of bytes to copy to the output streamjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void copy(byte[] value,
int off,
int len)
throws java.io.IOException,
Asn1Exception
copy in interface Asn1XmlXerEncodervalue - Array of bytes to copy to the output streamoff - Starting offset in arraylen - The length to be encodedjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void copy(java.lang.String value)
throws java.io.IOException,
Asn1Exception
copy in interface Asn1XmlXerEncodervalue - The string value to copyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void write(java.lang.String value)
throws java.io.IOException,
Asn1Exception
value - The string value to copyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void decrLevel()
decrLevel in interface Asn1XmlXerEncoderpublic void encodeByte(byte value)
throws java.io.IOException
value - The byte value to copyjava.io.IOException - Any exception thrown by the underlying OutputStream.public void encodeData(java.lang.String value)
throws java.io.IOException,
Asn1Exception
encodeData in interface Asn1XmlXerEncodervalue - String value to encodejava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeBinStrValue(byte[] bits,
int nbits)
throws java.io.IOException,
Asn1Exception
encodeBinStrValue in interface Asn1XmlXerEncoderbits - Bit string to encodejava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeHexStrValue(byte[] data)
throws java.io.IOException,
Asn1Exception
encodeHexStrValue in interface Asn1XmlXerEncoderdata - Data to encodejava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeEndDocument()
throws java.io.IOException,
Asn1Exception
encodeEndDocument in interface Asn1XmlXerEncoderjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeEndElement(java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeEndElement in interface Asn1XerEncoderelemName - The name of element.java.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeStartDocument()
throws java.io.IOException,
Asn1Exception
encodeStartDocument in interface Asn1XmlXerEncoderjava.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeStartElement(java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeStartElement in interface Asn1XerEncoderelemName - The name of element.java.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeEmptyElement(java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeEmptyElement in interface Asn1XerEncoderelemName - The name of element.java.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeNamedValueElement(java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeNamedValueElement in interface Asn1XmlXerEncoderelemName - The name of element.java.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeNamedValue(java.lang.String valueName,
java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeNamedValue in interface Asn1XerEncodervalueName - The name of value.elemName - The name of element.java.io.IOException - If I/O error occurs.Asn1Exception - Thrown, if operation is failed.public void encodeRealValue(double value,
java.lang.String elemName)
throws java.io.IOException,
Asn1Exception
encodeRealValue in interface Asn1XerEncodervalue - 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 Asn1XerEncoderpublic void incrLevel()
incrLevel in interface Asn1XmlXerEncoderpublic void indent()
throws java.io.IOException,
Asn1Exception
indent in interface Asn1XmlXerEncoderjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public boolean isCanonical()
Asn1XmlXerEncoderisCanonical in interface Asn1XmlXerEncoderAsn1XmlXerEncoderpublic void setCanonical(boolean value)
value - Canonical encoding flag.public void setState(int stat)
setState in interface Asn1XerEncoderstat - Buffer Stat