public abstract class Asn1EncodeBuffer extends Asn1MessageBuffer
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_SIZE
This constant specifies the default initial size of the encode buffer.
|
protected int |
mByteIndex |
protected byte[] |
mData |
context, mTypeCode
Modifier and Type | Method and Description |
---|---|
abstract 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 |
binDump(java.lang.String varName)
This method invokes an overloaded version of binDump to dump
the encoded message to standard output.
|
protected void |
checkSize(int bytesRequired)
This method determines if the encode buffer can hold the requested
number of bytes.
|
abstract void |
copy(byte value)
This abstract method is used to copy a single byte to the
encode buffer.
|
abstract void |
copy(byte[] value)
This method copies multiple bytes to the encode buffer
|
abstract byte[] |
getMsgCopy()
This method returns the encoded message in a byte array.
|
abstract int |
getMsgLength()
This method returns the length (in bytes) of the encoded
message component.
|
void |
hexDump()
This method dumps the encoded message in hex/ascii format to
the standard output stream.
|
void |
hexDump(java.io.PrintStream out)
This method dumps the encoded message in hex/ascii format to
the given print output stream.
|
protected void |
initBuffer(int size) |
abstract void |
reset()
This method resets the buffer to allow a new record to be encoded
into it.
|
int |
trimBitString(Asn1BitString bitstr)
This method will trim a BIT STRING for relevant encodings by removing
all zero trailing bits.
|
abstract void |
write(java.io.OutputStream out)
This method writes the encoded record to the given output stream.
|
addNamedEventHandler, getEventHandlerListCount, getInputStream, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
getContext, hexDump, hexDump, setKey, setTypeCode
protected int mByteIndex
protected byte[] mData
public static final int INITIAL_SIZE
public void binDump(java.lang.String varName)
public abstract void binDump(java.io.PrintStream out, java.lang.String varName)
protected void checkSize(int bytesRequired)
bytesRequired
- Number of required bytes.public int trimBitString(Asn1BitString bitstr)
bitstr
- An ASN.1 BIT STRING object.public abstract void copy(byte value)
value
- The byte value to copypublic abstract void copy(byte[] value) throws Asn1Exception
value
- Array of bytes to copy to the encode bufferAsn1Exception
public abstract byte[] getMsgCopy()
public abstract int getMsgLength()
public void hexDump()
public void hexDump(java.io.PrintStream out)
out
- Output stream object referenceprotected void initBuffer(int size)
public abstract void reset()
public abstract void write(java.io.OutputStream out) throws java.io.IOException
out
- Output stream to which record is to be writtenjava.io.IOException