Search in sources :

Example 1 with Utf8Writer

use of jcog.data.string.Utf8Writer in project narchy by automenta.

the class IO method writeUTF8WithPreLen.

// public static void writeUTF8(String s, DataOutput o) throws IOException {
// new Utf8Writer(o).write(s);
// }
public static void writeUTF8WithPreLen(String s, DataOutput o) throws IOException {
    DynBytes d = new DynBytes(s.length());
    new Utf8Writer(d).write(s);
    o.writeShort(d.length());
    d.appendTo(o);
}
Also used : DynBytes(jcog.data.byt.DynBytes) Utf8Writer(jcog.data.string.Utf8Writer)

Aggregations

DynBytes (jcog.data.byt.DynBytes)1 Utf8Writer (jcog.data.string.Utf8Writer)1