@Test
    public void testVarudintEncoding() throws Exception {
        // Decimal: 1234567891234567891
        // Binary:  1000100100010000100001111010011000000001000111011011011010011
        // Groups of 7 bits:
        //  0010001  0010001  0000100  0011110  1001100  0000001  0001110  1101101  1010011
        // Var length unsigned int binary:
        // 10010001 10010001 10000100 10011110 11001100 10000001 10001110 11101101 01010011
        // Var length unsigned int hex-bytes:
        // 91       91       84       9E       CC       81       8E       ED       53
        byte[] bytes = new byte[] {(byte) 0x91, (byte) 0x91, (byte) 0x84, (byte) 0x9E, (byte) 0xCC, (byte) 0x81, (byte) 0x8E, (byte) 0xED, (byte) 0x53};

        // Parse the input
        ReadBufferByteBased readBufferByteBased = new ReadBufferByteBased(bytes);
        BigInteger bigIntegerValue = readBufferByteBased.readUnsignedBigInteger("test", bytes.length * 8, WithReaderWriterArgs.WithEncoding("VARUDINT"));

        // Check the expected value matches
        Assertions.assertEquals(new BigInteger("1234567891234567891"), bigIntegerValue);

        // Serialize the value again
        WriteBufferByteBased writeBufferByteBased = new WriteBufferByteBased(bytes.length);
        writeBufferByteBased.writeUnsignedBigInteger("test", bytes.length * 8, bigIntegerValue, WithReaderWriterArgs.WithEncoding("VARUDINT"));

        // Check the output matches the original one
        byte[] serializedBytes = writeBufferByteBased.getBytes();
        Assertions.assertArrayEquals(bytes, serializedBytes);
    }
In VARUDINT encoding is var length unsigned integer encoding.

@throws Exception something went wrong
plc4j/spi/src/test/java/org/apache/plc4x/java/spi/generation/UnsignedBigIntegerTest.java