docs: public static void marshallSize(ObjectOutput out, int value) throws IOException {
        if (value < 0) {
           out.writeByte(0x80); //meaning it is a negative value!
           return;
        }
        if ((value & ~0x3F) == 0) { // fits in 1 byte
           out.writeByte(value & 0x3F); //first bit is 0 (== positive) and second bit is zero (== not more bytes)
           return;
        }
        out.writeByte((value & 0x3F) | 0x40); //set second bit to 1 (== more bytes)
        value >>>= 6; //6 bits written so far
        //normal code for unsigned int. only the first byte is special
        while ((value & ~0x7F) != 0) {
           out.writeByte((byte) ((value & 0x7f) | 0x80));
           value >>>= 7;
        }
        out.writeByte((byte) value);
     }