private static int findPos(byte[] data, int pos, int len) {
        int ret = -1;
        if (data != null) {
            int dlen = data.length;
            if (dlen < pos + len) {
                len = dlen - pos;
            }
            byte[] tmp = new byte[len];
            System.arraycopy(data, pos, tmp, 0, len);
            boolean found = true;
            int dd = 0;
            for (; dd < pos - len; dd++) {
                found = true;
                for (int i = 0; i < len; i++) {
                    byte b1 = tmp[i];
                    byte b2 = data[dd + i];
                    if (b1 != b2) {
                        // TODO Not match
                        found = false;
                        break;
                    }
                }
                if (found) {
                    break;
                }
            }
            if (found) {
                ret = dd;
            }
        }
        return ret;
    }