|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objsys.asn1j.runtime.Asn1MessageBuffer
com.objsys.asn1j.runtime.Asn1EncodeBuffer
com.objsys.asn1j.runtime.Asn1BerEncodeBuffer
This class handles the encoding of 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.Asn1EncodeBuffer |
mByteIndex, mData, mSizeIncrement, SIZE_INCREMENT |
| Constructor Summary | |
Asn1BerEncodeBuffer()
This constructor creates a BER encode buffer object with the default size increment. |
|
Asn1BerEncodeBuffer(int sizeIncrement)
This constructor creates a BER encode buffer object with the given size increment. |
|
| Method Summary | |
void |
binDump()
|
void |
binDump(java.io.PrintStream out,
java.lang.String varName)
This method dumps the encoded message in a human-readable format showing tags and contents to the given print output stream. |
protected void |
checkSize(int bytesRequired)
This method determines if the encode buffer can hold the requested number of bytes. |
void |
copy(byte value)
This method copies a single byte to the encode buffer. |
void |
copy(byte[] value)
This method copies multiple bytes to the encode buffer |
void |
copy(byte[] value,
int startOffset,
int length)
This method copies multiple bytes to the encode buffer |
void |
copy(java.lang.String value)
This method copies a character string into the encode buffer |
int |
encodeIdentifier(int ident)
This method encodes an ASN.1 identifier value such as the ones used in a tags or object identifiers. |
int |
encodeIntValue(long ivalue)
This method encodes an ASN.1 integer value's contents according to the ASN.1 Basic Encoding Rules (BER).. |
int |
encodeLength(int len)
This method encodes a length value. |
int |
encodeTag(Asn1Tag tag)
This method encodes a tag value. |
int |
encodeTagAndLength(Asn1Tag tag,
int len)
This method encodes both a tag and length value. |
int |
encodeTagAndLength(short tagClass,
short tagForm,
int tagIDCode,
int len)
This overloaded version of encodeTagAndLength allows tag value components to be specified instead of an Asn1Tag object |
java.io.ByteArrayInputStream |
getByteArrayInputStream()
This method returns a reference to a byte array input stream representing the encoded message. |
java.io.InputStream |
getInputStream()
This method returns an input stream representing the encoded message. |
byte[] |
getMsgCopy()
This method returns the encoded message in a byte array. |
int |
getMsgLength()
This method returns the length of the encoded message component. |
void |
reset()
This method resets the buffer to allow a new record to be encoded into it. |
java.lang.String |
toString()
This method will return a string representation of the data in the encode buffer. |
void |
write(java.io.OutputStream out)
This method writes the encoded record to the given output stream. |
| Methods inherited from class com.objsys.asn1j.runtime.Asn1EncodeBuffer |
binDump, hexDump, hexDump, initBuffer |
| Methods inherited from class com.objsys.asn1j.runtime.Asn1MessageBuffer |
hexDump, hexDump, setKey |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Asn1BerEncodeBuffer()
public Asn1BerEncodeBuffer(int sizeIncrement)
sizeIncrement - The initial size in bytes of an encode buffer.
If the buffer becomes full, it will be expanded by the amount.| Method Detail |
protected void checkSize(int bytesRequired)
checkSize in class Asn1EncodeBufferbytesRequired - Number of required bytes.public void copy(byte value)
copy in class Asn1EncodeBuffervalue - The byte value to copy
public void copy(byte[] value)
throws Asn1Exception
copy in class Asn1EncodeBuffervalue - Array of bytes to copy to the encode buffer
Asn1Exception
public void copy(byte[] value,
int startOffset,
int length)
throws Asn1Exception
value - Array of bytes to copy to the encode buffer
Asn1Exceptionpublic void copy(java.lang.String value)
value - String to copy to the encode bufferpublic int encodeIdentifier(int ident)
ident - The identifier to be encoded.
public int encodeIntValue(long ivalue)
ivalue - Integer value to encode
public int encodeLength(int len)
len - The length to be encoded.
public int encodeTag(Asn1Tag tag)
tag - The tag to be encoded.
public int encodeTagAndLength(Asn1Tag tag,
int len)
tag - The tag to be encoded.len - The length to be encoded.
public int encodeTagAndLength(short tagClass,
short tagForm,
int tagIDCode,
int len)
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.len - The length to be encoded.
public java.io.ByteArrayInputStream getByteArrayInputStream()
public java.io.InputStream getInputStream()
getInputStream in class Asn1MessageBufferpublic byte[] getMsgCopy()
getMsgCopy in class Asn1EncodeBufferpublic int getMsgLength()
getMsgLength in class Asn1EncodeBuffer
public void binDump(java.io.PrintStream out,
java.lang.String varName)
binDump in class Asn1EncodeBufferpublic void binDump()
public void reset()
reset in class Asn1EncodeBufferpublic java.lang.String toString()
public void write(java.io.OutputStream out)
throws java.io.IOException
write in class Asn1EncodeBufferout - Output stream to which record is to be written
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||