public abstract class Asn1EncodeByteBufferRev extends Asn1EncodeBuffer
Modifier and Type | Field and Description |
---|---|
protected int |
mByteIndex |
protected byte[] |
mData |
INITIAL_SIZE
context, mTypeCode
Constructor and Description |
---|
Asn1EncodeByteBufferRev()
The default constructor initializes the encode buffer to the default
buffer size (INITIAL_SIZE bytes).
|
Asn1EncodeByteBufferRev(int size)
This constructor allows specification of the initial size.
|
Modifier and Type | Method and Description |
---|---|
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
|
java.io.ByteArrayInputStream |
getByteArrayInputStream()
This method returns a reference to a byte array 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.
|
protected void |
initBuffer(int size) |
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.
|
binDump, binDump, encodeIntSigned, encodeIntUnsigned, getInputStream, getMinimalOctetsSigned, getMinimalOctetsUnsigned, getOutputStream, hexDump, hexDump
addNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
getContext, hexDump, hexDump, setKey, setTypeCode
public Asn1EncodeByteBufferRev()
public Asn1EncodeByteBufferRev(int size)
size
- initial Buffer sizeprotected void checkSize(int bytesRequired)
bytesRequired
- Number of required bytes.public void copy(byte value)
copy
in class Asn1EncodeBuffer
value
- The byte value to copypublic void copy(byte[] value) throws Asn1Exception
copy
in class Asn1EncodeBuffer
value
- Array of bytes to copy to the encode bufferAsn1Exception
public void copy(byte[] value, int startOffset, int length) throws Asn1Exception
copy
in class Asn1EncodeBuffer
value
- Array of bytes to copy to the encode bufferstartOffset
- The first byte copied is value[offset]length
- The last byte copied is value[offset + len - 1]Asn1Exception
public void copy(java.lang.String value)
value
- String to copy to the encode bufferpublic java.io.ByteArrayInputStream getByteArrayInputStream()
getByteArrayInputStream
in class Asn1EncodeBuffer
public final byte[] getMsgCopy()
getMsgCopy
in class Asn1EncodeBuffer
public int getMsgLength()
getMsgLength
in class Asn1EncodeBuffer
protected void initBuffer(int size)
public void reset()
reset
in class Asn1EncodeBuffer
public java.lang.String toString()
toString
in class java.lang.Object
public final void write(java.io.OutputStream out) throws java.io.IOException
write
in class Asn1EncodeBuffer
out
- Output stream to which record is to be writtenjava.io.IOException
- for any I/O error.