public interface Asn1Writer extends Closeable, Flushable
Methods for creating Asn1Writer
s are provided in the Asn1
class.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this ASN.1 writer, flushing it first.
|
void |
flush()
Flushes this ASN.1 writer so that any buffered elements are written
immediately to their intended destination.
|
Asn1Writer |
writeBoolean(boolean value)
Writes a boolean element using the Universal Boolean ASN.1 type tag.
|
Asn1Writer |
writeBoolean(byte type,
boolean value)
Writes a boolean element using the provided type tag.
|
Asn1Writer |
writeEndSequence()
Finishes writing a sequence element.
|
Asn1Writer |
writeEndSet()
Finishes writing a set element.
|
Asn1Writer |
writeEnumerated(byte type,
int value)
Writes an enumerated element using the provided type tag.
|
Asn1Writer |
writeEnumerated(int value)
Writes an enumerated element using the Universal Enumerated ASN.1 type
tag.
|
Asn1Writer |
writeInteger(byte type,
int value)
Writes an integer element using the provided type tag.
|
Asn1Writer |
writeInteger(byte type,
long value)
Writes an integer element using the provided type tag.
|
Asn1Writer |
writeInteger(int value)
Writes an integer element using the Universal Integer ASN.1 type tag.
|
Asn1Writer |
writeInteger(long value)
Writes an integer element using the Universal Integer ASN.1 type tag.
|
Asn1Writer |
writeNull()
Writes a null element using the Universal Null ASN.1 type tag.
|
Asn1Writer |
writeNull(byte type)
Writes a null element using the provided type tag.
|
Asn1Writer |
writeOctetString(byte[] value)
Writes an octet string element using the Universal Octet String ASN.1
type tag.
|
Asn1Writer |
writeOctetString(byte[] value,
int offset,
int length)
Writes an octet string element using the Universal Octet String ASN.1
type tag.
|
Asn1Writer |
writeOctetString(byte type,
byte[] value)
Writes an octet string element using the provided type tag.
|
Asn1Writer |
writeOctetString(byte type,
byte[] value,
int offset,
int length)
Writes an octet string element using the provided type tag.
|
Asn1Writer |
writeOctetString(byte type,
ByteSequence value)
Writes an octet string element using the provided type tag.
|
Asn1Writer |
writeOctetString(byte type,
CharSequence value)
Writes a string as a UTF-8 encoded octet string element using the
provided type tag.
|
Asn1Writer |
writeOctetString(ByteSequence value)
Writes an octet string element using the Universal Octet String ASN.1
type tag.
|
Asn1Writer |
writeOctetString(CharSequence value)
Writes a string as a UTF-8 encoded octet string element using the
Universal Octet String ASN.1 type tag.
|
Asn1Writer |
writeStartSequence()
Writes a sequence element using the Universal Sequence ASN.1 type tag.
|
Asn1Writer |
writeStartSequence(byte type)
Writes a sequence element using the provided type tag.
|
Asn1Writer |
writeStartSet()
Writes a set element using the Universal Set ASN.1 type tag.
|
Asn1Writer |
writeStartSet(byte type)
Writes a set element using the provided type tag.
|
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- If an error occurs while closing.void flush() throws IOException
flush()
invocation will
flush all the buffers in a chain of streams.
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
flush
in interface Flushable
IOException
- If an error occurs while flushing.Asn1Writer writeBoolean(boolean value) throws IOException
value
- The boolean value.IOException
- If an error occurs while writing the element.Asn1Writer writeBoolean(byte type, boolean value) throws IOException
type
- The type tag of the element.value
- The boolean value.IOException
- If an error occurs while writing the element.Asn1Writer writeEndSequence() throws IOException
IOException
- If an error occurs while writing the element.IllegalStateException
- If there is no sequence being written.Asn1Writer writeEndSet() throws IOException
IOException
- If an error occurs while writing the element.IllegalStateException
- If there is no set being written.Asn1Writer writeEnumerated(byte type, int value) throws IOException
type
- The type tag of the element.value
- The enumerated value.IOException
- If an error occurs while writing the element.Asn1Writer writeEnumerated(int value) throws IOException
value
- The enumerated value.IOException
- If an error occurs while writing the element.Asn1Writer writeInteger(byte type, int value) throws IOException
type
- The type tag of the element.value
- The integer value.IOException
- If an error occurs while writing the element.Asn1Writer writeInteger(byte type, long value) throws IOException
type
- The type tag of the element.value
- The integer value.IOException
- If an error occurs while writing the element.Asn1Writer writeInteger(int value) throws IOException
value
- The integer value.IOException
- If an error occurs while writing the element.Asn1Writer writeInteger(long value) throws IOException
value
- The integer value.IOException
- If an error occurs while writing the element.Asn1Writer writeNull() throws IOException
IOException
- If an error occurs while writing the element.Asn1Writer writeNull(byte type) throws IOException
type
- The type tag of the element.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte type, byte[] value) throws IOException
type
- The type tag of the element.value
- The byte array containing the octet string data.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte type, byte[] value, int offset, int length) throws IOException
type
- The type tag of the element.value
- The byte array containing the octet string data.offset
- The offset in the byte array.length
- The number of bytes to write.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte type, ByteSequence value) throws IOException
type
- The type tag of the element.value
- The octet string value.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte type, CharSequence value) throws IOException
type
- The type tag of the element.value
- The string to be written as a UTF-8 encoded octet string.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte[] value) throws IOException
value
- The byte array containing the octet string data.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(byte[] value, int offset, int length) throws IOException
value
- The byte array containing the octet string data.offset
- The offset in the byte array.length
- The number of bytes to write.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(ByteSequence value) throws IOException
value
- The octet string value.IOException
- If an error occurs while writing the element.Asn1Writer writeOctetString(CharSequence value) throws IOException
value
- The string to be written as a UTF-8 encoded octet string.IOException
- If an error occurs while writing the element.Asn1Writer writeStartSequence() throws IOException
writeEndSequence()
is called.IOException
- If an error occurs while writing the element.Asn1Writer writeStartSequence(byte type) throws IOException
writeEndSequence()
is
called.type
- The type tag of the element.IOException
- If an error occurs while writing the element.Asn1Writer writeStartSet() throws IOException
writeEndSet()
is
called.IOException
- If an error occurs while writing the element.Asn1Writer writeStartSet(byte type) throws IOException
writeEndSet()
is called.type
- The type tag of the element.IOException
- If an error occurs while writing the element.Copyright 2010-2022 ForgeRock AS.