class BaseDescriptor {
    int tag;
    int sizeOfInstance;
    int sizeBytes;

    public BaseDescriptor() {
    }

    public int getTag() {
        return tag;
    }

    public void writeSize(ByteBuffer bb, int size) {
        int pos = bb.position();

        int i = 0;
        while (size > 0 || i < sizeBytes) {
            i++;
            if (size > 0) {
                bb.put(pos + getSizeSize() - i, (byte) (size & 0x7f));
            } else {
                bb.put(pos + getSizeSize() - i, (byte) (0x80));
            }
            size >>>= 7;

        }

        ((Buffer)bb).position(pos + getSizeSize());

    }

    public int getSizeSize() {<FILL_FUNCTION_BODY>}


    public int getSize() {
        return getContentSize() + getSizeSize() + 1;
    }

    public final void parse(int tag, ByteBuffer bb) throws IOException {
        this.tag = tag;

        int i = 0;
        int tmp = IsoTypeReader.readUInt8(bb);
        i++;
        sizeOfInstance = tmp & 0x7f;
        while (tmp >>> 7 == 1) { //nextbyte indicator bit
            tmp = IsoTypeReader.readUInt8(bb);
            i++;
            //sizeOfInstance = sizeOfInstance<<7 | sizeByte;
            sizeOfInstance = sizeOfInstance << 7 | tmp & 0x7f;
        }
        sizeBytes = i;
        ByteBuffer detailSource = bb.slice();
        ((Buffer)detailSource).limit(sizeOfInstance);
        parseDetail(detailSource);
        assert detailSource.remaining() == 0 : this.getClass().getSimpleName() + " has not been fully parsed";
        ((Buffer)bb).position(bb.position() + sizeOfInstance);
    }

    public abstract void parseDetail(ByteBuffer bb) throws IOException;

    public abstract ByteBuffer serialize();

    abstract int getContentSize();

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("BaseDescriptor");
        sb.append("{tag=").append(tag);
        sb.append(", sizeOfInstance=").append(sizeOfInstance);
        sb.append('}');
        return sb.toString();
    }
}

        int size = getContentSize();
        int i = 0;
        while (size > 0 || i < sizeBytes) {
            size >>>= 7;
            i++;
        }
        return i;
    
<no_super_class>