Class Ecoji.Decoder

  • Enclosing class:
    Ecoji

    public static class Ecoji.Decoder
    extends java.lang.Object
    Decodes Unicode character sources from a base-1024 representation with an emoji alphabet into bytes. Use one of the readFrom() methods to start the decoding process.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Ecoji.Decoder.Target
      An intermediate class, needed to implement the builder-like DSL for decoding.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Ecoji.Decoder.Target readFrom​(java.io.Reader reader)
      Uses the provided Reader as a source of emoji characters.
      Ecoji.Decoder.Target readFrom​(java.lang.String string)
      Uses the provided String as a source of emoji characters.
      • Methods inherited from class java.lang.Object

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

      • readFrom

        public Ecoji.Decoder.Target readFrom​(java.io.Reader reader)
        Uses the provided Reader as a source of emoji characters.

        The provided stream will be read entirely, however, it won't be closed automatically. It is expected that the entirety of the stream is a valid Ecoji-encoded data; if any of the code points read from the stream do not belong to the Ecoji alphabet, an exception will be thrown. An exception will also be thrown if the number of code points in the input is not a multiple of 4.

        Parameters:
        reader - A Reader which contains Ecoji-encoded data.
        Returns:
        An intermediate object used to specify the destination of the decoding process.
      • readFrom

        public Ecoji.Decoder.Target readFrom​(java.lang.String string)
        Uses the provided String as a source of emoji characters.

        It is expected that the entire string contains valid Ecoji-encoded data; if any of the code points of which the string consists of do not belong to the Ecoji alphabet, an exception will be thrown. An exception will also be thrown if the number of code points in the string is not a multiple of 4.

        Parameters:
        string - A String containing Ecoji-encoded data.
        Returns:
        An intermediate object used to specify the destination of the decoding process.