Package io.github.netvl.ecoji
Class Ecoji.Decoder
- java.lang.Object
-
- io.github.netvl.ecoji.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 thereadFrom()
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 providedReader
as a source of emoji characters.Ecoji.Decoder.Target
readFrom(java.lang.String string)
Uses the providedString
as a source of emoji characters.
-
-
-
Method Detail
-
readFrom
public Ecoji.Decoder.Target readFrom(java.io.Reader reader)
Uses the providedReader
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
- AReader
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 providedString
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
- AString
containing Ecoji-encoded data.- Returns:
- An intermediate object used to specify the destination of the decoding process.
-
-