Class PlainText

  • All Implemented Interfaces:
    Bytes

    public final class PlainText
    extends Object
    implements Bytes
    A byte sequence constructed from plain text.
    • Constructor Detail

      • PlainText

        public PlainText​(String utf8String)
        Creates a new byte sequence from an utf8String.
        Parameters:
        utf8String - an UTF-8 encoded String
      • PlainText

        public PlainText​(String string,
                         Charset charset)
        Creates a new byte sequence from a string with the specified charset.
        Parameters:
        string - the String argument
        charset - the charset of string
    • Method Detail

      • asArray

        public byte[] asArray()
        Description copied from interface: Bytes
        Returns this byte sequence as an array.
        Specified by:
        asArray in interface Bytes
        Returns:
        a fresh byte array copy of this byte sequence