|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.objsys.asn1j.runtime.Asn1OutputStream
com.objsys.asn1j.runtime.Asn1BerOutputStream
This class implements the output stream to encode ASN.1 messages as specified in the Basic Encoding Rules (BER) as specified in the ITU-T X.690 standard. A reference to an object of this type is passed to each of the ASN.1 type encode methods involved in encoding a particular message type.
| Field Summary |
| Fields inherited from class com.objsys.asn1j.runtime.Asn1OutputStream |
os |
| Constructor Summary | |
Asn1BerOutputStream(java.io.OutputStream os)
This constructor creates a buffered BER output stream object with default size of buffer. |
|
Asn1BerOutputStream(java.io.OutputStream os,
int bufSize)
This constructor creates a buffered BER output stream object. |
|
| Method Summary | |
void |
encode(Asn1Type object,
boolean explicit)
This method encodes and writes to the stream ASN.1 types. |
void |
encodeBitString(byte[] value,
int numbits,
boolean explicit,
Asn1Tag tag)
This method writes the given array of bytes as bit string value. |
void |
encodeBMPString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
This method writes the given string as BMP string value. |
void |
encodeCharString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
This method encodes and writes to the stream an ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. |
void |
encodeEOC()
This method encodes and writes an End-Of-Contents marker to the stream. |
void |
encodeIdentifier(long ident)
This method encodes and writes to the stream an ASN.1 identifier value such as those used in tags or object identifiers. |
void |
encodeIntValue(long value,
boolean encodeLen)
This method encodes and writes to the stream an ASN.1 integer value's contents according to the ASN.1 Basic Encoding Rules (BER). |
void |
encodeLength(int len)
This method encodes and writes a length value to the stream. |
void |
encodeOctetString(byte[] value,
boolean explicit,
Asn1Tag tag)
This method writes the given array of bytes as octet string value. |
void |
encodeTag(Asn1Tag tag)
This method encodes and writes a tag value to the stream. |
void |
encodeTag(short tagClass,
short tagForm,
int tagIDCode)
This method encodes and writes a tag value to the stream. |
void |
encodeTagAndIndefLen(Asn1Tag tag)
This method encodes and writes both a tag and an indefinite length indicator to the stream. |
void |
encodeTagAndIndefLen(short tagClass,
short tagForm,
int tagIDCode)
This overloaded version of encodeTagAndIndefLen allows tag value components to be specified instead of an Asn1Tag object. |
void |
encodeTagAndLength(Asn1Tag tag,
int len)
This method encodes and writes both a tag and length value to the stream. |
void |
encodeUnivString(int[] value,
boolean explicit,
Asn1Tag tag)
This method writes the given array of integers as UniversalString value. |
| Methods inherited from class com.objsys.asn1j.runtime.Asn1OutputStream |
close, flush, write, write, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Asn1BerOutputStream(java.io.OutputStream os)
os - The underlying OutputStream object.
public Asn1BerOutputStream(java.io.OutputStream os,
int bufSize)
os - The underlying OutputStream object.bufSize - The buffer size. If it is 0 then the output stream
is used as unbuffered one.| Method Detail |
public void encodeIdentifier(long ident)
throws java.io.IOException
ident - The identifier to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeTag(Asn1Tag tag)
throws java.io.IOException
tag - The tag to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeTag(short tagClass,
short tagForm,
int tagIDCode)
throws java.io.IOException
tagClass - The class of the tag to be encoded.tagForm - The form of the tag to be encoded.tagIDCode - The ID code of the tag to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeLength(int len)
throws java.io.IOException
len - The length to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeTagAndLength(Asn1Tag tag,
int len)
throws java.io.IOException
tag - The tag to be encoded.len - The length to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeTagAndIndefLen(Asn1Tag tag)
throws java.io.IOException
tag - The tag to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeTagAndIndefLen(short tagClass,
short tagForm,
int tagIDCode)
throws java.io.IOException
tagClass - The class of the tag to be encoded.tagForm - The form of the tag to be encoded.tagIDCode - The ID code of the tag to be encoded.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeEOC()
throws java.io.IOException
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeIntValue(long value,
boolean encodeLen)
throws java.io.IOException
value - Integer value to encode.encodeLen - Flag indicating length determinant should be
encoded before encoding integer value.
java.io.IOException - Any exception thrown by the underlying OutputStream.
public void encodeBMPString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
value - String containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to apply
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception - Thrown, if operation is failed.
public void encodeBitString(byte[] value,
int numbits,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
value - Byte array containing data to encode.numbits - Number of bits to encodeexplicit - Flag indicating explicit tagging should be donetag - Universal tag to apply
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception - Thrown, if operation is failed.
public void encodeCharString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
value - The string object to be writtenexplicit - Flag indicating explicit tagging should be donetag - Universal tag to apply
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception - Thrown, if operation is failed.
public void encodeOctetString(byte[] value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
value - Byte array containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to apply
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception - Thrown, if operation is failed.
public void encodeUnivString(int[] value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
value - Array containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to apply
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception - Thrown, if operation is failed.
public void encode(Asn1Type object,
boolean explicit)
throws java.io.IOException,
Asn1Exception
object - The object to be writtenexplicit - Flag indicating explicit tagging should be done
java.io.IOException - Any exception thrown by the underlying OutputStream.
Asn1Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||