Class AbstractASN1Writer

java.lang.Object
org.forgerock.opendj.io.AbstractASN1Writer
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, ASN1Writer

public abstract class AbstractASN1Writer extends Object implements ASN1Writer
An abstract ASN1Writer which can be used as the basis for implementing new ASN1 writer implementations.
  • Constructor Details

  • Method Details

    • writeBoolean

      public ASN1Writer writeBoolean(boolean value) throws IOException
      Description copied from interface: ASN1Writer
      Writes a boolean element using the Universal Boolean ASN.1 type tag.
      Specified by:
      writeBoolean in interface ASN1Writer
      Parameters:
      value - The boolean value.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeEnumerated

      public ASN1Writer writeEnumerated(int value) throws IOException
      Description copied from interface: ASN1Writer
      Writes an enumerated element using the Universal Enumerated ASN.1 type tag.
      Specified by:
      writeEnumerated in interface ASN1Writer
      Parameters:
      value - The enumerated value.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeInteger

      public ASN1Writer writeInteger(int value) throws IOException
      Description copied from interface: ASN1Writer
      Writes an integer element using the Universal Integer ASN.1 type tag.
      Specified by:
      writeInteger in interface ASN1Writer
      Parameters:
      value - The integer value.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeInteger

      public ASN1Writer writeInteger(long value) throws IOException
      Description copied from interface: ASN1Writer
      Writes an integer element using the Universal Integer ASN.1 type tag.
      Specified by:
      writeInteger in interface ASN1Writer
      Parameters:
      value - The integer value.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeNull

      public ASN1Writer writeNull() throws IOException
      Description copied from interface: ASN1Writer
      Writes a null element using the Universal Null ASN.1 type tag.
      Specified by:
      writeNull in interface ASN1Writer
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeOctetString

      public ASN1Writer writeOctetString(byte type, byte[] value) throws IOException
      Description copied from interface: ASN1Writer
      Writes an octet string element using the provided type tag.
      Specified by:
      writeOctetString in interface ASN1Writer
      Parameters:
      type - The type tag of the element.
      value - The byte array containing the octet string data.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeOctetString

      public ASN1Writer writeOctetString(byte[] value) throws IOException
      Description copied from interface: ASN1Writer
      Writes an octet string element using the Universal Octet String ASN.1 type tag.
      Specified by:
      writeOctetString in interface ASN1Writer
      Parameters:
      value - The byte array containing the octet string data.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeOctetString

      public ASN1Writer writeOctetString(byte[] value, int offset, int length) throws IOException
      Description copied from interface: ASN1Writer
      Writes an octet string element using the Universal Octet String ASN.1 type tag.
      Specified by:
      writeOctetString in interface ASN1Writer
      Parameters:
      value - The byte array containing the octet string data.
      offset - The offset in the byte array.
      length - The number of bytes to write.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeOctetString

      Description copied from interface: ASN1Writer
      Writes an octet string element using the Universal Octet String ASN.1 type tag.
      Specified by:
      writeOctetString in interface ASN1Writer
      Parameters:
      value - The octet string value.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeOctetString

      Description copied from interface: ASN1Writer
      Writes a string as a UTF-8 encoded octet string element using the Universal Octet String ASN.1 type tag.
      Specified by:
      writeOctetString in interface ASN1Writer
      Parameters:
      value - The string to be written as a UTF-8 encoded octet string.
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeStartSequence

      Description copied from interface: ASN1Writer
      Writes a sequence element using the Universal Sequence ASN.1 type tag. All further writes will append elements to the sequence until ASN1Writer.writeEndSequence() is called.
      Specified by:
      writeStartSequence in interface ASN1Writer
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.
    • writeStartSet

      Description copied from interface: ASN1Writer
      Writes a set element using the Universal Set ASN.1 type tag. All further writes will append elements to the set until ASN1Writer.writeEndSet() is called.
      Specified by:
      writeStartSet in interface ASN1Writer
      Returns:
      A reference to this ASN.1 writer.
      Throws:
      IOException - If an error occurs while writing the element.