static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }
static void toBinaryString(final DataOutput out, final String str) throws IOException { final int strlen = str.length(); byte[] bytes = new byte[strlen*4]; // Codepoints expand to 4 bytes max int utf8Len = 0; int idx = 0; while(idx < strlen) { final int cpt = str.codePointAt(idx); idx += Character.isSupplementaryCodePoint(cpt) ? 2 : 1; utf8Len += writeUtf8(cpt, bytes, utf8Len); } writeVInt(out, utf8Len); out.write(bytes, 0, utf8Len); }