public final ByteList transform(byte[] src, int off, int size) {
        ByteList ob = null;
        int i = 0, org;

        while (i < size) {
            org = i;
            while (i < size && src[off + i] != AMPER) {
                i++;
            }

            if (i > org) {
                if (org == 0) {
                    if (i >= size) {
                        return null;
                    }

                    ob = buf_grow(ob, HOUDINI_UNESCAPED_SIZE(size));
                }

                ob = buf_put(ob, src, off + org, i - org);
            }

		    /* escaping */
            if (i >= size)
                break;

            i++;
            if (ob == null) ob = new ByteList();
            i += unescape_ent(ob, src, off + i, size - i);
        }

        return ob;
    }