private boolean parse()

in src/main/java/com/aliyun/openservices/log/common/FastLog.java [28:75]


    private boolean parse() {
        int pos = this.beginOffset;
        int mode, index;
        boolean findTime = false;
        while (pos < this.endOffset) {
            int[] value = VarintUtil.DecodeVarInt32(this.rawBytes, pos, this.endOffset);
            if (value[0] == 0) {
                return false;
            }
            mode = value[1] & 0x7;
            index = value[1] >> 3;
            if (mode == 0) {
                pos = value[2];
                value = VarintUtil.DecodeVarInt32(this.rawBytes, pos, this.endOffset);
                if (value[0] == 0) {
                    return false;
                }
                pos = value[2];
                if (index == 1) {
                    this.time = value[1];
                    findTime = true;
                }
            } else if (mode == 1) {
                pos = value[2] + 8;
            } else if (mode == 2) {
                pos = value[2];
                value = VarintUtil.DecodeVarInt32(this.rawBytes, pos, this.endOffset);
                if (value[0] == 0) {
                    return false;
                }
                pos = value[2] + value[1];
                if (index == 2) {
                    this.contents.add(new FastLogContent(this.rawBytes, value[2], value[1]));
                }
            } else if (mode == 5) {
                if (index == 4) {
                    timeNsPart = this.rawBytes[value[2]] & 255 |
                            (this.rawBytes[value[2] + 1] & 255) << 8 |
                            (this.rawBytes[value[2] + 2] & 255) << 16 |
                            (this.rawBytes[value[2] + 3] & 255) << 24;
                }
                pos = value[2] + 4;
            } else {
                return false;
            }
        }
        return findTime && (pos == this.endOffset);
    }