Class Ecoji


  • public final class Ecoji
    extends java.lang.Object
    The main entry point for Ecoji encoding/decoding.

    Use the getEncoder() and getDecoder() methods to obtain an instance of Ecoji.Encoder and Ecoji.Decoder, respectively. These classes can then be used to read encoded or decoded data and produce base-1024 decoded or encoded data.

    As a general rule, for Ecoji.Encoder the input is an InputStream and the output is a Writer. For Ecoji.Decoder it's in the opposite way: the input is a Reader and the output is a OutputStream. However, both provide convenience methods to encode from or decode to Strings and byte[]s.

    For example:

       String encoded = Ecoji.getEncoder().readFrom("hello world").writeToString();
       String decoded = Ecoji.getDecoder().readFrom(encoded).writeToString();
       assert decoded.equals("hello world");
     
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Ecoji.Decoder
      Decodes Unicode character sources from a base-1024 representation with an emoji alphabet into bytes.
      static class  Ecoji.Encoder
      Encodes byte sources into a base-1024 representation with an emoji alphabet.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Ecoji.Decoder getDecoder()
      Returns an instance of the Ecoji.Decoder class, which can then be used to decode a stream or a sequence of characters which is an Ecoji representation of a byte stream into the original sequence of bytes.
      static Ecoji.Encoder getEncoder()
      Returns an instance of the Ecoji.Encoder class, which can then be used to encode any stream or sequence of bytes into a base-1024 representation.
      • Methods inherited from class java.lang.Object

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

      • getEncoder

        public static Ecoji.Encoder getEncoder()
        Returns an instance of the Ecoji.Encoder class, which can then be used to encode any stream or sequence of bytes into a base-1024 representation.
        Returns:
        An instance of Ecoji.Encoder.
      • getDecoder

        public static Ecoji.Decoder getDecoder()
        Returns an instance of the Ecoji.Decoder class, which can then be used to decode a stream or a sequence of characters which is an Ecoji representation of a byte stream into the original sequence of bytes.
        Returns:
        An instance of Ecoji.Decoder.