Class BERCharacterString

java.lang.Object
netscape.ldap.ber.stream.BERElement
netscape.ldap.ber.stream.BERCharacterString
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BERNumericString, BERPrintableString, BERVisibleString

public abstract class BERCharacterString extends BERElement
This is an abstract base class for character string types.
Version:
1.0 seeAlso CCITT X.209
See Also:
  • Field Details

    • m_value

      protected String m_value
      Internal variables
  • Constructor Details

    • BERCharacterString

      public BERCharacterString()
      Constructs a character string element containing a buffer.
    • BERCharacterString

      public BERCharacterString(String string)
      Constructs a character string element containing buffer.
      Parameters:
      string - a string value
    • BERCharacterString

      public BERCharacterString(byte[] buffer)
      Constructs a character string element from a byte array.
      Parameters:
      buffer - buffer containing UTF8 data
    • BERCharacterString

      public BERCharacterString(BERTagDecoder decoder, InputStream stream, int[] bytes_read) throws IOException
      Constructs a character string element from an input stream (for constructed encoding)
      Parameters:
      stream - input stream
      bytes_read - array of 1 int, incremented by number of bytes read
      Throws:
      IOException - failed to construct
    • BERCharacterString

      public BERCharacterString(InputStream stream, int[] bytes_read) throws IOException
      Constructs a character string element from an input stream (for primitive encoding)
      Parameters:
      stream - source
      bytes_read - array of 1 int, incremented by number of bytes read
      Throws:
      IOException - failed to construct
  • Method Details

    • write

      public void write(OutputStream stream) throws IOException
      Writes BER to stream.
      Specified by:
      write in class BERElement
      Parameters:
      stream - output stream
      Throws:
      IOException
    • getValue

      public String getValue()
      Gets the element value.
    • getType

      public abstract int getType()
      Gets the element type.
      Specified by:
      getType in class BERElement
      Returns:
      element type.
    • toString

      public abstract String toString()
      Gets the string representation.
      Specified by:
      toString in class BERElement
      Returns:
      string representation.