public class BEREncoder
extends java.lang.Object
Constructor and Description |
---|
BEREncoder(boolean utf8)
Constructor.
|
BEREncoder(boolean utf8,
int initialSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
append(boolean value)
Appends a boolean value.
|
void |
append(boolean value,
int code)
Appends a boolean value with the specified ASN.1 type code.
|
void |
append(byte[] bytes)
Appends an octetstring value.
|
void |
append(byte[] bytes,
int code)
Appends an octetstring value with the specified ASN.1 type code.
|
void |
append(int value)
Appends an integer value.
|
void |
append(int value,
int code)
Appends an integer value with the specified ASN.1 type code.
|
void |
append(java.lang.String value)
Appends a string value.
|
void |
append(java.lang.String value,
int code)
Appends a string value with the specified ASN.1 type code.
|
void |
appendFilter(java.lang.String filter)
Appends an RFC2254 search filter to this encoder.
|
void |
appendNull()
Appends a BER NULL value.
|
void |
reset()
Reset this encoder for reuse.
|
int |
size()
Returns the current size of the encoded data.
|
byte[] |
toByteArray()
Returns the encoded data.
|
public BEREncoder(boolean utf8)
utf
- whether to use UTF-8 for encoding stringspublic BEREncoder(boolean utf8, int initialSize)
utf
- whether to use UTF-8 for encoding stringsinitialSize
- the initial buffer sizepublic void reset()
public int size()
public byte[] toByteArray()
public void append(boolean value)
value
- the valuepublic void append(boolean value, int code)
value
- the valuecode
- the type codepublic void append(int value)
value
- the valuepublic void append(int value, int code)
value
- the valuecode
- the type codepublic void append(byte[] bytes) throws BERException
bytes
- the valueBERException
public void append(byte[] bytes, int code) throws BERException
bytes
- the valuecode
- the type codeBERException
public void append(java.lang.String value) throws BERException
value
- the valueBERException
public void append(java.lang.String value, int code) throws BERException
value
- the valuecode
- the type codeBERException
public void appendNull()
public void appendFilter(java.lang.String filter) throws BERException
filter
- the filter expressionBERException