Class Ecoji.Encoder.Target

  • Enclosing class:
    Ecoji.Encoder

    public static class Ecoji.Encoder.Target
    extends java.lang.Object
    An intermediate class, needed to implement the builder-like DSL for encoding.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int writeTo​(java.io.Writer writer)
      Writes the base-1024 representation of bytes contained in the previously specified source to the provided Writer.
      java.lang.String writeToString()
      Writes the base-1024 representation of bytes contained in the previously specified source as a String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • writeTo

        public int writeTo​(java.io.Writer writer)
                    throws java.io.IOException
        Writes the base-1024 representation of bytes contained in the previously specified source to the provided Writer.

        Note that most of the emoji used in the alphabet do not belong to the Basic Multilingual Plane, therefore they are encoded as a pair of UTF-16 code units, i.e. as a surrogate pair.

        The passed Writer will not be closed after the operation finishes.

        Parameters:
        writer - An Writer which will accept the Ecoji-encoded data.
        Returns:
        A number of chars written to the provided Writer.
        Throws:
        java.io.IOException - If an error has happened during a read or a write operation.
      • writeToString

        public java.lang.String writeToString()
                                       throws java.io.IOException
        Writes the base-1024 representation of bytes contained in the previously specified source as a String.

        Note that most of the emoji used in the alphabet do not belong to the Basic Multilingual Plane, therefore they are encoded as a pair of UTF-16 code units, i.e. as a surrogate pair.

        Returns:
        A String containing the base-1024 representation of the input.
        Throws:
        java.io.IOException - If an error has happened during a read operation.