Package io.github.netvl.ecoji
Class Ecoji
- java.lang.Object
 - 
- io.github.netvl.ecoji.Ecoji
 
 
- 
public final class Ecoji extends java.lang.ObjectThe main entry point for Ecoji encoding/decoding.Use the
getEncoder()andgetDecoder()methods to obtain an instance ofEcoji.EncoderandEcoji.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.Encoderthe input is anInputStreamand the output is aWriter. ForEcoji.Decoderit's in the opposite way: the input is aReaderand the output is aOutputStream. However, both provide convenience methods to encode from or decode toStrings andbyte[]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 classEcoji.DecoderDecodes Unicode character sources from a base-1024 representation with an emoji alphabet into bytes.static classEcoji.EncoderEncodes 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.DecodergetDecoder()Returns an instance of theEcoji.Decoderclass, 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.EncodergetEncoder()Returns an instance of theEcoji.Encoderclass, which can then be used to encode any stream or sequence of bytes into a base-1024 representation. 
 - 
 
- 
- 
Method Detail
- 
getEncoder
public static Ecoji.Encoder getEncoder()
Returns an instance of theEcoji.Encoderclass, 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 theEcoji.Decoderclass, 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. 
 
 - 
 
 -