Package io.github.netvl.ecoji
Class Ecoji.Encoder.Target
- java.lang.Object
-
- io.github.netvl.ecoji.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 providedWriter
.java.lang.String
writeToString()
Writes the base-1024 representation of bytes contained in the previously specified source as aString
.
-
-
-
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 providedWriter
.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
- AnWriter
which will accept the Ecoji-encoded data.- Returns:
- A number of
char
s written to the providedWriter
. - 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 aString
.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.
-
-