@@ -0,0 +1,2193 @@
+package io.github.bckfnn.taggersty;%0A%0Aimport java.util.ArrayList;%0A%0Apublic class UTFByteArrayOutput implements TagsOutput %7B%0A    static final int BUF_SIZE = 8 * 1024;%0A%0A    private ArrayList%3Cbyte%5B%5D%3E buffers = new ArrayList%3C%3E();%0A%0A    private byte%5B%5D buffer = new byte%5BBUF_SIZE%5D;%0A    private int pos = 0;%0A%0A    @Override%0A    public void write(String s) %7B%0A        //System.out.println(s);%0A%0A        int l = s.length();%0A        for (int i = 0; i %3C l; i++) %7B%0A            char ch = s.charAt(i);%0A            if (ch %3C= 0x7F) %7B%0A                add((byte) ch);%0A            %7D else if (ch %3C= 0x7FF) %7B%0A                add((byte) (0xc0 %7C (ch %3E%3E 6)));%0A                add((byte) (0x80 %7C (ch & 0x3f)));%0A            %7D else %7B%0A                add((byte) (0xe0 %7C (ch %3E%3E 12)));%0A                add((byte) (0x80 %7C ((ch %3E%3E 6) & 0x3f)));%0A                add((byte) (0x80 %7C (ch & 0x3f)));%0A            %7D%0A        %7D%0A    %7D%0A%0A    private final void add(byte b) %7B%0A        try %7B%0A            buffer%5Bpos++%5D = b;%0A        %7D catch (ArrayIndexOutOfBoundsException e) %7B%0A            buffers.add(buffer);%0A            buffer = new byte%5BBUF_SIZE%5D;%0A            pos = 0;%0A            buffer%5Bpos++%5D = b;%0A        %7D%0A    %7D%0A%0A%0A%0A    @Override%0A    public void write(char%5B%5D s) %7B%0A        int l = s.length;%0A        for (int i = 0; i %3C l; i++) %7B%0A            try %7B%0A                buffer%5Bpos++%5D = (byte) s%5Bi%5D;%0A            %7D catch (ArrayIndexOutOfBoundsException e) %7B%0A                buffers.add(buffer);%0A                buffer = new byte%5BBUF_SIZE%5D;%0A                pos = 0;%0A                buffer%5Bpos++%5D = (byte) s%5Bi%5D;%0A            %7D%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void write(char c) %7B%0A        try %7B%0A            buffer%5Bpos++%5D = (byte) c;%0A        %7D catch (ArrayIndexOutOfBoundsException e) %7B%0A            buffers.add(buffer);%0A            buffer = new byte%5BBUF_SIZE%5D;%0A            pos = 0;%0A            buffer%5Bpos++%5D = (byte) c;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        StringBuilder sb = new StringBuilder();%0A        for (byte%5B%5D b : buffers) %7B%0A            sb.append(new String(b));%0A        %7D%0A        sb.append(new String(buffer, 0, pos));%0A        return sb.toString();%0A    %7D%0A%0A    @Override%0A    public void close() %7B%0A    %7D%0A%0A%7D%0A

add an UTF byte array output class.